convilyn 1.1.1b1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. convilyn-1.1.1b1/.gitignore +12 -0
  2. convilyn-1.1.1b1/CHANGELOG.md +241 -0
  3. convilyn-1.1.1b1/LICENSE +201 -0
  4. convilyn-1.1.1b1/PKG-INFO +126 -0
  5. convilyn-1.1.1b1/docs/QUICKSTART.md +380 -0
  6. convilyn-1.1.1b1/docs/README.md +87 -0
  7. convilyn-1.1.1b1/docs/STABILITY.md +85 -0
  8. convilyn-1.1.1b1/examples/01_convert_docx_to_pdf.py +30 -0
  9. convilyn-1.1.1b1/examples/02_async_convert.py +37 -0
  10. convilyn-1.1.1b1/examples/03_api_escape_hatch.py +41 -0
  11. convilyn-1.1.1b1/examples/04_convert_cli.sh +31 -0
  12. convilyn-1.1.1b1/examples/05_goals_doc_analyzer.py +58 -0
  13. convilyn-1.1.1b1/examples/06_goals_async_events.py +66 -0
  14. convilyn-1.1.1b1/examples/07_goals_cli.sh +50 -0
  15. convilyn-1.1.1b1/examples/08_workflows_marketplace.py +60 -0
  16. convilyn-1.1.1b1/examples/09_account_quota.py +75 -0
  17. convilyn-1.1.1b1/examples/README.md +33 -0
  18. convilyn-1.1.1b1/examples/sample.txt +10 -0
  19. convilyn-1.1.1b1/pyproject.toml +135 -0
  20. convilyn-1.1.1b1/src/convilyn/__init__.py +116 -0
  21. convilyn-1.1.1b1/src/convilyn/_internal/__init__.py +6 -0
  22. convilyn-1.1.1b1/src/convilyn/_internal/auth.py +141 -0
  23. convilyn-1.1.1b1/src/convilyn/_internal/http.py +644 -0
  24. convilyn-1.1.1b1/src/convilyn/_internal/loop_runner.py +75 -0
  25. convilyn-1.1.1b1/src/convilyn/_internal/resilience.py +185 -0
  26. convilyn-1.1.1b1/src/convilyn/_internal/throttle.py +175 -0
  27. convilyn-1.1.1b1/src/convilyn/_internal/urlpolicy.py +85 -0
  28. convilyn-1.1.1b1/src/convilyn/_internal/ws.py +166 -0
  29. convilyn-1.1.1b1/src/convilyn/_version.py +14 -0
  30. convilyn-1.1.1b1/src/convilyn/cli/__init__.py +15 -0
  31. convilyn-1.1.1b1/src/convilyn/cli/_exit_codes.py +21 -0
  32. convilyn-1.1.1b1/src/convilyn/cli/_output.py +159 -0
  33. convilyn-1.1.1b1/src/convilyn/cli/account.py +174 -0
  34. convilyn-1.1.1b1/src/convilyn/cli/api.py +279 -0
  35. convilyn-1.1.1b1/src/convilyn/cli/convert.py +276 -0
  36. convilyn-1.1.1b1/src/convilyn/cli/doctor.py +233 -0
  37. convilyn-1.1.1b1/src/convilyn/cli/goals.py +638 -0
  38. convilyn-1.1.1b1/src/convilyn/cli/main.py +44 -0
  39. convilyn-1.1.1b1/src/convilyn/client.py +120 -0
  40. convilyn-1.1.1b1/src/convilyn/config.py +35 -0
  41. convilyn-1.1.1b1/src/convilyn/exceptions.py +251 -0
  42. convilyn-1.1.1b1/src/convilyn/py.typed +0 -0
  43. convilyn-1.1.1b1/src/convilyn/resources/__init__.py +29 -0
  44. convilyn-1.1.1b1/src/convilyn/resources/account.py +162 -0
  45. convilyn-1.1.1b1/src/convilyn/resources/convert.py +321 -0
  46. convilyn-1.1.1b1/src/convilyn/resources/files.py +287 -0
  47. convilyn-1.1.1b1/src/convilyn/resources/goals.py +513 -0
  48. convilyn-1.1.1b1/src/convilyn/resources/workflows.py +230 -0
  49. convilyn-1.1.1b1/src/convilyn/sync_client.py +106 -0
  50. convilyn-1.1.1b1/src/convilyn/types.py +481 -0
  51. convilyn-1.1.1b1/tests/__init__.py +0 -0
  52. convilyn-1.1.1b1/tests/_fixtures/__init__.py +0 -0
  53. convilyn-1.1.1b1/tests/_fixtures/ws_fakes.py +93 -0
  54. convilyn-1.1.1b1/tests/contract/__init__.py +0 -0
  55. convilyn-1.1.1b1/tests/contract/test_public_surface.py +292 -0
  56. convilyn-1.1.1b1/tests/integration/__init__.py +0 -0
  57. convilyn-1.1.1b1/tests/integration/test_examples_syntax.py +140 -0
  58. convilyn-1.1.1b1/tests/packaging/__init__.py +0 -0
  59. convilyn-1.1.1b1/tests/packaging/test_py_typed_marker.py +36 -0
  60. convilyn-1.1.1b1/tests/packaging/test_version_changelog_sync.py +78 -0
  61. convilyn-1.1.1b1/tests/unit/__init__.py +0 -0
  62. convilyn-1.1.1b1/tests/unit/_internal/__init__.py +0 -0
  63. convilyn-1.1.1b1/tests/unit/_internal/test_auth.py +109 -0
  64. convilyn-1.1.1b1/tests/unit/_internal/test_auto_throttle_transport.py +204 -0
  65. convilyn-1.1.1b1/tests/unit/_internal/test_http.py +246 -0
  66. convilyn-1.1.1b1/tests/unit/_internal/test_loop_runner.py +94 -0
  67. convilyn-1.1.1b1/tests/unit/_internal/test_resilience.py +244 -0
  68. convilyn-1.1.1b1/tests/unit/_internal/test_throttle.py +178 -0
  69. convilyn-1.1.1b1/tests/unit/_internal/test_urlpolicy.py +83 -0
  70. convilyn-1.1.1b1/tests/unit/_internal/test_ws.py +483 -0
  71. convilyn-1.1.1b1/tests/unit/cli/__init__.py +0 -0
  72. convilyn-1.1.1b1/tests/unit/cli/test_account.py +160 -0
  73. convilyn-1.1.1b1/tests/unit/cli/test_api.py +274 -0
  74. convilyn-1.1.1b1/tests/unit/cli/test_cli_subprocess.py +61 -0
  75. convilyn-1.1.1b1/tests/unit/cli/test_convert.py +308 -0
  76. convilyn-1.1.1b1/tests/unit/cli/test_doctor.py +194 -0
  77. convilyn-1.1.1b1/tests/unit/cli/test_goals.py +974 -0
  78. convilyn-1.1.1b1/tests/unit/cli/test_output.py +130 -0
  79. convilyn-1.1.1b1/tests/unit/resources/__init__.py +0 -0
  80. convilyn-1.1.1b1/tests/unit/resources/conftest.py +19 -0
  81. convilyn-1.1.1b1/tests/unit/resources/test_account.py +452 -0
  82. convilyn-1.1.1b1/tests/unit/resources/test_convert.py +339 -0
  83. convilyn-1.1.1b1/tests/unit/resources/test_files.py +435 -0
  84. convilyn-1.1.1b1/tests/unit/resources/test_goals.py +576 -0
  85. convilyn-1.1.1b1/tests/unit/resources/test_workflows.py +346 -0
  86. convilyn-1.1.1b1/tests/unit/test_client.py +123 -0
@@ -0,0 +1,12 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ venv/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .coverage
9
+ coverage.xml
10
+ .pytest_cache/
11
+ .ruff_cache/
12
+ .mypy_cache/
@@ -0,0 +1,241 @@
1
+ # Changelog — `convilyn` (consumer SDK)
2
+
3
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/);
4
+ versioning follows [Semantic Versioning](https://semver.org/).
5
+
6
+ ## [Unreleased]
7
+
8
+ ## [1.1.1b1] — 2026-07-07
9
+
10
+ ### Security
11
+
12
+ - **Storage URLs are validated before the client dials them.** The
13
+ client now rejects an upload/download URL whose host resolves to a
14
+ loopback, link-local, or private address (in addition to the existing
15
+ https-only check), so a malformed or tampered response cannot redirect
16
+ an upload or download to an internal target.
17
+ - **Downloads are streamed with a size cap** instead of being buffered
18
+ whole in memory, so a very large or hostile response cannot exhaust
19
+ memory. Uploads are likewise capped (`MAX_UPLOAD_BYTES`) and fail fast.
20
+ - **`base_url` must be https** for any non-loopback host — the API key
21
+ travels in an `Authorization` header, so an `http://` target is
22
+ refused to avoid sending it in cleartext. Loopback hosts may use http
23
+ for local development.
24
+ - **WebSocket URLs must be `wss://`** for any non-loopback host, and
25
+ connection errors no longer include the auth token from the URL.
26
+
27
+ ### Changed
28
+
29
+ - Docstrings, README, and CHANGELOG were revised for clarity; no public
30
+ API changed.
31
+
32
+ ## [1.1.0] — 2026-07-07
33
+
34
+ First published release (PyPI). Sections below accumulated since 1.0.1;
35
+ the `Removed` entries predate any published version, so no released
36
+ consumer is affected.
37
+
38
+ > **Events are polling-only in v1**: retrieve goal progress with
39
+ > `client.goals.wait(...)` / `retrieve(...)`. The WebSocket gateway does
40
+ > not accept consumer `ck_` keys yet; `goals.events()` streaming is
41
+ > roadmap (see `docs/STABILITY.md`).
42
+
43
+ ### Fixed
44
+
45
+ - `files.upload` now speaks the backend's presigned-**POST** upload grant: when the presign response carries `fields`, the SDK multipart-POSTs (fields verbatim, file part last) instead of PUTting — the backend switched input uploads to a size-capped S3 POST policy (`content-length-range`) and a PUT against the POST URL fails with S3 403. A grant without `fields` still uses the legacy presigned-PUT path, so the SDK works against both backend generations.
46
+ - The synchronous `Convilyn` client now runs every call — and the final `close()` — on **one private, long-lived event loop** instead of a fresh `asyncio.run` loop per call. Per-call loops orphaned pooled `httpx` connections, which touched their already-closed loop at interpreter teardown and crashed the CLI on Windows (`RuntimeError: Event loop is closed`). Calling a sync method after `close()` now raises a clear `RuntimeError`, and calling one from inside a running event loop still raises with guidance to use `AsyncConvilyn`.
47
+ - A **failed** conversion job now surfaces `JobFailedError` even when the backend attaches a 0-byte placeholder result file. `ResultFile.size` was `Field(gt=0)`, so parsing a failed job whose `resultFiles[0].size == 0` raised a pydantic `ValidationError` instead — masking the real failure. The bound is now `ge=0`.
48
+ - `convert.create` now sends the discriminated-union tag as snake_case `processor_type` (was camelCase `processorType`); the file-conversion `JobRequest` discriminator is `processor_type` per the contract (`processorType` is only the *response* field name), so the previous key made the backend reject every conversion with HTTP 400 `union_tag_not_found`. File conversions now succeed against the current backend.
49
+ - The CLI `--json` output now escapes non-ASCII (`ensure_ascii=True`); a raw glyph in a payload (e.g. a `✓` from a job) previously crashed with `UnicodeEncodeError` on a non-UTF-8 console (Windows `cp950`).
50
+ - `goals.start(slots=...)` now sends the answers as `slotAnswers` (`[{slotId, value}]`); the previous `slots` payload had no matching field on the create endpoint and was silently dropped, so pre-seeded slot answers never reached the backend.
51
+ - Goal-job parsing now coerces wire-`null` `pendingInterrupts` / `pendingSlots` / `fileIds` / `filledSlots` to an empty list/dict via a before-validator; the backend legitimately returns `null` for these, which previously raised a validation error on the non-optional fields and made the whole `GoalJob` unparseable.
52
+ - File uploads from a path now send a length-bearing bytes body (so httpx emits `Content-Length`); the previous async-generator body made httpx use `Transfer-Encoding: chunked`, which an S3 presigned PUT rejects with HTTP 501. Path-based uploads now succeed against real storage.
53
+
54
+ ### Changed
55
+
56
+ - **`goals.events()` failure now points at `wait()` polling.** The WS gateway
57
+ does not accept `ck_` keys in v1, so a connect failure's `WebSocketError`
58
+ message and the method docstring now spell out that WebSocket streaming is
59
+ polling-only for now (use `wait()`), mirroring the consumer-go guidance.
60
+ - **Author-SDK / developer-portal tokens (`cvl_` / `cvi_`) are now rejected**
61
+ by `APIKey` / `Convilyn(api_key=...)` with a precise `AuthError`, instead of
62
+ being treated as acceptable consumer keys (they never authenticated against
63
+ the data plane — the backend answered with an opaque 401). The `ck_` prefix
64
+ and any unknown prefix are still accepted (forward-compat). Brings the Python
65
+ consumer SDK in line with the TypeScript one's `auth.ts` guard.
66
+
67
+ ### Removed
68
+
69
+ - **BREAKING: `GoalJob.workflow_id`** — the backend's `GoalJobResponse` never
70
+ echoes `workflowId` (the *request* accepts it; the response does not), so the
71
+ attribute was always `None` at runtime. Removed pre-first-publish, so no
72
+ released consumer is affected. `goals.start(workflow_id=...)` /
73
+ `run(workflow_id=...)` and the `Workflow` / `WorkflowSummary` models are
74
+ unchanged. `GoalJob` is now conformance-mapped in `sdk/sdks.json`, so any
75
+ future field the wire doesn't speak fails CI instead of shipping silently.
76
+
77
+ ### Added
78
+
79
+ - **`client.goals.start(..., llm_config_id=...)` / `run(..., llm_config_id=...)`**
80
+ — optionally pin a goal run to one of your stored BYO-LLM provider configs
81
+ (created in the console) so the run executes on your own provider/key. Omit it
82
+ to use your account default. Serialised as `llmConfigId`; honoured only when
83
+ BYO-LLM is enabled for your account, otherwise the run uses the platform
84
+ provider.
85
+
86
+ ### Fixed
87
+
88
+ - **Default API base URL** — corrected to `https://api.convilyn.corenovus.com`
89
+ (was `https://api.convilyn.com`, which does not serve the API), so a default
90
+ `Convilyn()` reaches the real backend out of the box. The base URL is the host
91
+ root — resource paths carry their own `/api/v1` prefix.
92
+ - **API-key prefix** — the canonical consumer key is now `ck_` (minted in the
93
+ API Console / Settings → API), matching the backend (`USER_API_KEY_PREFIX`)
94
+ and the docs. `ACCEPTED_KEY_PREFIXES` now includes `ck_` (the developer-portal
95
+ `cvl_` / `cvi_` tiers stay recognised); the quickstart + `convilyn doctor`
96
+ examples show `ck_`. The runnable `examples/*` now lead with `ck_` too,
97
+ completing the alignment.
98
+ - **Stale post-rename references** — after the `sdk-consumer` →
99
+ `sdk-consumer-python` directory rename, the `pyproject.toml`
100
+ `[project.urls]` (Changelog / Source Code), the `examples/03` AGENT.md
101
+ reference, and the `examples/README.md` test-path link now point at
102
+ `sdk-consumer-python`.
103
+
104
+ ### Added
105
+
106
+ - **`CONVILYN_BASE_URL` environment override** — the client now honours the
107
+ `CONVILYN_BASE_URL` env var (precedence: explicit `base_url=` arg →
108
+ `CONVILYN_BASE_URL` → default), so the CLI and SDK can target a dev/staging
109
+ API without code changes. `convilyn doctor` already surfaced this var and now
110
+ reports the URL the client actually dials.
111
+ - **Public-API contract test** (`tests/contract/test_public_surface.py`) —
112
+ freezes `convilyn.__all__`, the per-resource method sets, and the
113
+ exception taxonomy, and fails if any `convilyn._internal` symbol leaks
114
+ into the public namespace or the surface grows unexpectedly. The keystone
115
+ guard behind the SemVer promise; see `docs/STABILITY.md`.
116
+ - **`convilyn.config`** — a public module home for the resilience config
117
+ types (`RetryPolicy`, `ExponentialBackoffRetry`, `NoRetry`,
118
+ `AutoThrottleConfig`). They are still re-exported from the top-level
119
+ `convilyn` namespace, so `from convilyn import RetryPolicy` is unchanged —
120
+ but the documented home is now a non-underscore module rather than
121
+ `convilyn._internal`.
122
+ - **`docs/STABILITY.md`** — the published stability & versioning policy:
123
+ what the public surface is, the SemVer promise, the deprecation policy,
124
+ and the documented `raw_request` escape-hatch caveat.
125
+
126
+ - **`Convilyn(auto_throttle=...)`** — opt-in retry loop for
127
+ `QuotaExceededError`. Pass `True` for the default policy (1 retry,
128
+ 60 s sleep cap, 5 s fallback delay) or an `AutoThrottleConfig` /
129
+ dict for tuned knobs. The SDK reads the server's
130
+ `details.retry_after_seconds` / `details.reset_at` hint when present
131
+ and gives up immediately if the implied sleep exceeds `max_sleep`,
132
+ so a misconfigured caller never blocks indefinitely.
133
+ - **Soft-limit signalling** — any response carrying the
134
+ `X-Quota-State: soft_limit` header now emits a
135
+ `convilyn.throttle` log warning + Python `UserWarning` and returns
136
+ normally (forward-compat wiring; the backend will emit the header
137
+ once the gateway support lands).
138
+ - **`client.account.usage_history(*, since=None)`** — list past usage
139
+ periods (one row per metric+period). Wraps
140
+ `GET /api/v1/payment/usage/history`; the new `UsageHistoryEntry`
141
+ model carries `metric`, `period_start`, `period_end`, `used`, and
142
+ optional `limit`. Pair with `client.account.get_quota()` for MTD
143
+ spend reviews.
144
+ - `CostEstimate` now exposes `estimated_total_micro_u`,
145
+ `estimated_min_micro_u`, and `estimated_max_micro_u` (wire aliases
146
+ `estimatedTotalMicroU` / `estimatedMinMicroU` / `estimatedMaxMicroU`).
147
+ Use these to render the projected cost range; the legacy
148
+ `estimated_micro_u` upper-bound field stays for back-compat.
149
+
150
+ ### Changed
151
+
152
+ - Renamed event types on `GoalEventType`: `specialist_started` →
153
+ `agent_step_started`, `specialist_finished` → `agent_step_finished`,
154
+ `handoff` → `orchestration_transition`. CLI glyphs follow.
155
+
156
+ ### Removed
157
+
158
+ - `CostEstimate.max_iterations` and
159
+ `CostEstimate.llm_cost_per_iter_micro_u` are no longer surfaced on
160
+ the model. Callers should rely on the new cost-range triple
161
+ (min / total / max).
162
+
163
+ ### Documentation
164
+
165
+ - The package (`convilyn/__init__.py`) and async-client (`client.py`)
166
+ docstrings now reflect the shipped resource surface — they previously
167
+ said resources "land in subsequent releases" / "follow-up commits"
168
+ while `client.files` / `convert` / `goals` / `workflows` / `account`
169
+ already ship.
170
+
171
+ ## [1.0.1] — 2026-06-30
172
+
173
+ ### Security
174
+
175
+ - **`https`-only scheme guard on backend-supplied URLs.** `external_get` /
176
+ `external_put` (the presigned-URL download/upload paths) now reject any URL
177
+ whose scheme is not `https` (e.g. `http://`, `file://`, an internal address
178
+ over plain HTTP). This is defence-in-depth against a compromised or MITM'd
179
+ backend returning a downgrade/SSRF URL. Scheme — not host — is checked, so
180
+ every legitimate https presign host (S3, CloudFront, custom domains) still
181
+ works.
182
+ - **`convert.download_to` refuses to write through an existing symlink** at the
183
+ destination path, so a pre-placed link cannot redirect the downloaded bytes.
184
+ Writing to a regular or new path is unaffected.
185
+ - **`convilyn doctor` secret masking tightened** — diagnostics now reveal only
186
+ the first 3 characters (the key tier prefix) and no longer print the trailing
187
+ 4 characters of an API key.
188
+
189
+ ## [1.0.0] — 2026-05-24
190
+
191
+ First production release. The package surface has stabilised across the
192
+ R1-R5 workstreams; the bump from `0.1.0` reflects API readiness, not a
193
+ breaking change.
194
+
195
+ ### Added
196
+
197
+ - **`client.account` resource** — `get_plan()` returns the caller's
198
+ billing tier; `get_quota(tools=..., max_iterations=...)` previews
199
+ workflow cost + returns the tier's quota verdict (`ok` /
200
+ `soft_limit` / `quota_exceeded`). Read-only, no side effects.
201
+ - **`convilyn account` CLI** — `convilyn account plan` and
202
+ `convilyn account quota` mirror the resource. Both support `--json`
203
+ for pipe consumption.
204
+ - **Typed billing exceptions**: `PlanRequiredError` (HTTP 402 +
205
+ `TIER_REQUIRED`) and `QuotaExceededError` (HTTP 402 +
206
+ `QUOTA_EXCEEDED`). Both subclass `APIError`, so existing
207
+ `except APIError:` handlers continue to catch them. Each carries an
208
+ `upgrade_url` for the caller's pricing CTA.
209
+ - **`client.workflows` resource** — community marketplace surface:
210
+ `search`, `get`, `fork`, `publish`, `patch`, `like`.
211
+ - **`client.goals` resource** — agentic AI workflows: `start`,
212
+ `wait`, `run`, `retrieve`, `fill_slot`, `confirm`, `cancel`, `retry`,
213
+ plus async-only `events()` WebSocket streaming.
214
+ - **`convilyn goals` CLI** — drive AI workflows from the shell.
215
+ NDJSON streaming for `events`; pinned exit codes (0 / 1 / 2 / 3 / 130).
216
+ - **`convilyn convert` CLI** + `client.convert` + `client.files`
217
+ resources (R1 ship).
218
+ - **`convilyn doctor` CLI** — environment + connectivity diagnostics
219
+ for the SDK's dependencies and auth setup.
220
+ - **`convilyn api` CLI** — `gh`-style escape hatch for any backend
221
+ endpoint the SDK has not wrapped yet.
222
+ - **Production-grade resilience**: retry on 5xx / 429 / 408 with
223
+ exponential backoff + jitter, `Idempotency-Key` auto-stamped on
224
+ mutating verbs, `Retry-After` honoured.
225
+
226
+ ### Changed
227
+
228
+ - Error envelope handling normalises three shapes: flat
229
+ `{code, message, ...}`, FastAPI `{"detail": {...}}`, and the older
230
+ `{"error": {...}}`. Callers now see the same typed exception
231
+ regardless of which endpoint raised.
232
+ - License moved from speculative `Apache-2.0` placeholder to `MIT`
233
+ (matches the repo's existing precedent under `llm-gateway/LICENSE`).
234
+
235
+ ### Documentation
236
+
237
+ - `docs/QUICKSTART.md` — 5-min Python + CLI walkthrough.
238
+ - `docs/README.md` — PyPI landing page.
239
+ - `AGENT.md` — SOLID seams + extension points for AI coding agents
240
+ contributing to the SDK.
241
+ - 9 runnable examples under `examples/01_*.py` … `09_account_quota.py`.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may accept (and charge a
167
+ fee for) acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend,
172
+ and hold each Contributor harmless for any liability incurred by,
173
+ or claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 CoreNovus contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
200
+ implied. See the License for the specific language governing
201
+ permissions and limitations under the License.
@@ -0,0 +1,126 @@
1
+ Metadata-Version: 2.4
2
+ Name: convilyn
3
+ Version: 1.1.1b1
4
+ Summary: Official Convilyn client SDK — file conversion, agentic workflows, community library
5
+ Project-URL: Homepage, https://convilyn.corenovus.com
6
+ Project-URL: Documentation, https://docs.convilyn.corenovus.com
7
+ Project-URL: Issues, https://github.com/CoreNovus/convilyn-python/issues
8
+ Project-URL: Repository, https://github.com/CoreNovus/convilyn-python
9
+ Project-URL: Source Code, https://github.com/CoreNovus/convilyn-python
10
+ Project-URL: Changelog, https://github.com/CoreNovus/convilyn-python/blob/main/CHANGELOG.md
11
+ Author-email: Convilyn <sdk@convilyn.corenovus.com>
12
+ License-Expression: Apache-2.0
13
+ License-File: LICENSE
14
+ Keywords: agent,ai,convilyn,file-conversion,mcp,workflow
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Internet :: WWW/HTTP
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.10
26
+ Requires-Dist: click<9.0.0,>=8.0.0
27
+ Requires-Dist: httpx<1.0.0,>=0.25.0
28
+ Requires-Dist: pydantic<3.0.0,>=2.0.0
29
+ Requires-Dist: typing-extensions>=4.7.0; python_version < '3.11'
30
+ Requires-Dist: websockets<17.0,>=13.0
31
+ Provides-Extra: author
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
34
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
35
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
36
+ Requires-Dist: respx>=0.22.0; extra == 'dev'
37
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # convilyn
41
+
42
+ Official Python client for the [Convilyn](https://convilyn.corenovus.com) API —
43
+ convert files, run AI workflows, and ship in five lines of Python or a
44
+ single shell command.
45
+
46
+ ```bash
47
+ pip install convilyn
48
+ export CONVILYN_API_KEY=ck_...
49
+ convilyn convert report.docx --to pdf
50
+ ```
51
+
52
+ ```python
53
+ from convilyn import Convilyn
54
+
55
+ client = Convilyn() # reads CONVILYN_API_KEY from env
56
+ file = client.files.upload("report.docx")
57
+ job = client.convert.create_and_wait(file=file, target_format="pdf")
58
+ client.convert.download_to(job, to="report.pdf")
59
+ ```
60
+
61
+ ## What you get
62
+
63
+ * **Python SDK** — `Convilyn` (sync) and `AsyncConvilyn` (async) with
64
+ resource-style accessors: `client.files`, `client.convert`,
65
+ `client.goals` (agentic / AI workflows with HITL slot filling),
66
+ `client.workflows` (community marketplace), and `client.account`
67
+ (billing tier + cost-preview).
68
+
69
+ > **Goal progress is polling-only in v1.** Follow a run with
70
+ > `client.goals.wait(...)` / `retrieve(...)` (or `convilyn goals
71
+ > status` from the shell). The WebSocket gateway does not accept
72
+ > consumer `ck_` keys yet, so `goals.events()` streaming raises with
73
+ > guidance pointing back at polling until that lands.
74
+ * **CLI** — five sub-command groups installed with the package:
75
+ * `convilyn convert <file> --to <format>` — upload, convert, download
76
+ * `convilyn doctor` — environment + connectivity diagnostics
77
+ * `convilyn api <METHOD> <PATH>` — gh-style escape hatch for any API endpoint
78
+ * `convilyn goals {start,status,events,fill-slot,confirm,cancel,retry}`
79
+ — drive AI workflows from the shell (NDJSON streaming, HITL,
80
+ pinned exit codes)
81
+ * `convilyn account {plan,quota}` — pre-flight your billing tier
82
+ and workflow cost before running
83
+ * **Free to install, metered to use** — `pip install convilyn` is free.
84
+ API calls draw on your monthly quota (a generous free tier is
85
+ available; Pro lifts the cap). The SDK raises typed
86
+ `PlanRequiredError` / `QuotaExceededError` (both subclass `APIError`)
87
+ when an action exceeds your tier — see
88
+ [QUICKSTART §8](./QUICKSTART.md#8-check-your-plan--quota-before-running-clientaccount).
89
+ * **Resilient by default** — retry on 5xx / 429 / 408
90
+ with exponential backoff + jitter, `Idempotency-Key` auto-stamped on
91
+ mutating verbs, `Retry-After` honoured.
92
+ * **AI-agent friendly** — every command supports `--json` for
93
+ machine-readable output, `--dry-run` for safe previews, and pinned
94
+ exit codes (0 / 1 / 2 / 3 / 130) so agent loops can branch on the
95
+ result without parsing free-text.
96
+
97
+ ## Companion package — building your own workflows
98
+
99
+ `convilyn` is the **consumer** SDK (you call the API). If you want to
100
+ *build* a tool server or author a workflow spec for the Convilyn
101
+ platform, install the **author** SDK:
102
+
103
+ ```bash
104
+ pip install convilyn-author # separate package
105
+ convilyn-author init my-server
106
+ ```
107
+
108
+ The two packages are intentionally separate so consumers don't pay
109
+ the uvicorn / FastAPI dependency cost. See
110
+ [`sdk/author-python`](https://github.com/CoreNovus/convilyn/tree/main/sdk/author-python)
111
+ in the source repo.
112
+
113
+ ## Next
114
+
115
+ * [QUICKSTART.md](./QUICKSTART.md) — 5-minute new-user guide (covers
116
+ convert, goals, workflows, and account / quota chapters)
117
+ * [STABILITY.md](./STABILITY.md) — what the public API is and the
118
+ SemVer / deprecation promise behind it
119
+ * [CHANGELOG.md](../CHANGELOG.md) — version history
120
+ * [examples/](../examples/) — runnable Python + shell scripts
121
+ * [AGENT.md](../AGENT.md) — guidance for AI coding agents
122
+ contributing to this SDK
123
+
124
+ ## Licence
125
+
126
+ MIT. See [`LICENSE`](../LICENSE).