Context
kbagent ships an importable Python SDK (keboola_agent_cli.client + keboola_agent_cli.services.*). Consumers such as the FIIA Scaffold Kit program against it directly, in-process.
Problem
The service layer mostly returns dict[str, Any] (e.g. JobService.run_job() -> dict[str, Any], WorkspaceService.execute_query(), StorageService.upload_table()). Consequences for SDK consumers:
- they couple to undocumented dict shapes,
- a breaking change in a return shape surfaces at runtime, not at type-check time,
- no IDE autocomplete on results.
The pattern for typed models already exists in the codebase — lineage_service and agent_service use pydantic — so this is about completing and exporting it consistently.
Request
- Define + export typed return models (pydantic) for the high-traffic service methods. Even a documented stable subset would help first: workspace query result, job result,
sync push result, config detail, upload-table result.
- Ship a
py.typed marker in the package so downstream mypy / IDEs treat the SDK as typed.
Benefit
The SDK is an agent-facing surface (relates to #152, Modern Agentic CLI). Typed contracts make integrations robust against version drift, self-documenting, and statically checkable — so a consumer's CI catches an SDK contract change before a customer build does.
Context
kbagent ships an importable Python SDK (
keboola_agent_cli.client+keboola_agent_cli.services.*). Consumers such as the FIIA Scaffold Kit program against it directly, in-process.Problem
The service layer mostly returns
dict[str, Any](e.g.JobService.run_job() -> dict[str, Any],WorkspaceService.execute_query(),StorageService.upload_table()). Consequences for SDK consumers:The pattern for typed models already exists in the codebase —
lineage_serviceandagent_serviceuse pydantic — so this is about completing and exporting it consistently.Request
sync pushresult, config detail, upload-table result.py.typedmarker in the package so downstreammypy/ IDEs treat the SDK as typed.Benefit
The SDK is an agent-facing surface (relates to #152, Modern Agentic CLI). Typed contracts make integrations robust against version drift, self-documenting, and statically checkable — so a consumer's CI catches an SDK contract change before a customer build does.