sanka-cli 0.2.7__tar.gz → 0.2.9__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.
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/PKG-INFO +36 -22
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/README.md +35 -17
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/pyproject.toml +3 -4
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/__init__.py +6 -2
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/_client.py +109 -31
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/cli/__init__.py +47 -26
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/__init__.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/connector_client.py +18 -14
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/connector_host.py +20 -16
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/engine.py +17 -17
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/execution/model.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/execution/report_codec.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/execution/routes.py +9 -9
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/execution/scope.py +8 -8
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/execution/validate.py +2 -2
- sanka_cli-0.2.9/src/sanka/runtime/extensions/artifacts.py +80 -0
- sanka_cli-0.2.9/src/sanka/runtime/extensions/code_lifecycle.py +214 -0
- sanka_cli-0.2.9/src/sanka/runtime/extensions/code_repair.py +185 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/extensions/discovery.py +4 -4
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/extensions/lifecycle.py +1 -65
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/extensions/model.py +9 -2
- sanka_cli-0.2.9/src/sanka/runtime/extensions/runner.py +258 -0
- sanka_cli-0.2.7/src/sanka/runtime/extensions/runner.py → sanka_cli-0.2.9/src/sanka/runtime/extensions/stage.py +65 -230
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/extensions/store.py +158 -37
- sanka_cli-0.2.9/src/sanka/runtime/flow/__init__.py +2 -0
- sanka_cli-0.2.9/src/sanka/runtime/flow/host.py +79 -0
- sanka_cli-0.2.9/src/sanka/runtime/flow/lifecycle.py +341 -0
- sanka_cli-0.2.9/src/sanka/runtime/flow/merge.py +109 -0
- sanka_cli-0.2.9/src/sanka/runtime/flow/model.py +240 -0
- sanka_cli-0.2.9/src/sanka/runtime/flow/planner.py +186 -0
- sanka_cli-0.2.9/src/sanka/runtime/flow/sqlite.py +406 -0
- sanka_cli-0.2.9/src/sanka/runtime/flow/state.py +55 -0
- sanka_cli-0.2.9/src/sanka/runtime/flow/verification.py +160 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/mapping/mapping_candidates.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/mapping/model.py +2 -2
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/mapping/owner_mapping.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/mapping/pending_relationships.py +3 -3
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/mapping/record_mapping.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/planner.py +2 -2
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/registry.py +37 -23
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/state.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/__init__.py +1 -1
- sanka_cli-0.2.9/src/sanka_cli/commands/code.py +19 -0
- sanka_cli-0.2.7/src/sanka_cli/commands/code.py → sanka_cli-0.2.9/src/sanka_cli/commands/functions.py +41 -37
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/commands/migrate.py +7 -7
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/main.py +9 -10
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/skills/sanka-cli/SKILL.md +9 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_connector/__about__.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_connector/__init__.py +54 -18
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_connector/credentials.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_connector/errors.py +27 -16
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_connector/protocols.py +24 -15
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_connector/provisioning.py +2 -2
- sanka_cli-0.2.9/src/sanka_connector/registration.py +42 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_connector/schema.py +10 -3
- sanka_cli-0.2.9/src/sanka_extension_sdk/__init__.py +32 -0
- sanka_cli-0.2.9/src/sanka_extension_sdk/contract.py +328 -0
- sanka_cli-0.2.9/src/sanka_extension_sdk/py.typed +0 -0
- sanka_cli-0.2.9/src/sanka_extensions/__init__.py +2 -0
- sanka_cli-0.2.9/src/sanka_extensions/code/__init__.py +32 -0
- sanka_cli-0.2.9/src/sanka_extensions/code/contract.py +4 -0
- sanka_cli-0.2.9/src/sanka_extensions/data/__about__.py +8 -0
- sanka_cli-0.2.9/src/sanka_extensions/data/__init__.py +256 -0
- sanka_cli-0.2.9/src/sanka_extensions/data/credentials.py +14 -0
- sanka_cli-0.2.9/src/sanka_extensions/data/errors.py +62 -0
- sanka_cli-0.2.9/src/sanka_extensions/data/protocols.py +78 -0
- sanka_cli-0.2.9/src/sanka_extensions/data/provisioning.py +42 -0
- sanka_cli-0.2.9/src/sanka_extensions/data/py.typed +0 -0
- sanka_cli-0.2.9/src/sanka_extensions/data/records.py +111 -0
- sanka_cli-0.2.9/src/sanka_extensions/data/registration.py +11 -0
- sanka_cli-0.2.9/src/sanka_extensions/data/schema.py +20 -0
- sanka_cli-0.2.9/src/sanka_extensions/flow/__init__.py +18 -0
- sanka_cli-0.2.9/src/sanka_extensions/flow/definition.py +140 -0
- sanka_cli-0.2.9/src/sanka_extensions/py.typed +0 -0
- sanka_cli-0.2.9/src/sanka_extensions/systems/__about__.py +6 -0
- sanka_cli-0.2.9/src/sanka_extensions/systems/__init__.py +132 -0
- sanka_cli-0.2.9/src/sanka_extensions/systems/credentials.py +8 -0
- sanka_cli-0.2.9/src/sanka_extensions/systems/errors.py +34 -0
- sanka_cli-0.2.9/src/sanka_extensions/systems/protocols.py +48 -0
- sanka_cli-0.2.9/src/sanka_extensions/systems/provisioning.py +24 -0
- sanka_cli-0.2.9/src/sanka_extensions/systems/py.typed +0 -0
- sanka_cli-0.2.9/src/sanka_extensions/systems/records.py +44 -0
- sanka_cli-0.2.9/src/sanka_extensions/systems/registration.py +7 -0
- sanka_cli-0.2.9/src/sanka_extensions/systems/schema.py +10 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/conftest.py +3 -3
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_cli.py +18 -13
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_code_commands.py +41 -22
- sanka_cli-0.2.9/tests/test_code_lifecycle.py +241 -0
- sanka_cli-0.2.9/tests/test_code_repair.py +207 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_connector_client.py +21 -21
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_connector_host.py +2 -2
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_credential_provider.py +7 -7
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_engine_e2e.py +2 -2
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_engine_execution_adoption.py +8 -8
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_engine_pg_to_clickhouse_e2e.py +2 -2
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_engine_postgres_e2e.py +2 -2
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_execution_exact_scope.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_execution_routes.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_execution_scope.py +2 -2
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_execution_seam.py +2 -2
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_execution_validate.py +12 -12
- sanka_cli-0.2.9/tests/test_extension_stage.py +245 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_extension_store.py +173 -0
- sanka_cli-0.2.9/tests/test_flow_lifecycle.py +405 -0
- sanka_cli-0.2.9/tests/test_flow_merge.py +73 -0
- sanka_cli-0.2.9/tests/test_flow_planner.py +229 -0
- sanka_cli-0.2.9/tests/test_flow_sqlite.py +168 -0
- sanka_cli-0.2.9/tests/test_flow_verification.py +179 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_hosted_cli.py +46 -3
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_mapping_candidates.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_mapping_owner_mapping.py +1 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_mapping_pending_relationships.py +2 -2
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_mapping_record_mapping.py +1 -1
- sanka_cli-0.2.9/tests/test_mcp_retirement.py +41 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_planner.py +7 -1
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_registry.py +20 -20
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_sanka_facade.py +52 -9
- sanka_cli-0.2.7/src/sanka_cli/mcp/__init__.py +0 -7
- sanka_cli-0.2.7/src/sanka_cli/mcp/client.py +0 -222
- sanka_cli-0.2.7/src/sanka_cli/mcp/render.py +0 -223
- sanka_cli-0.2.7/src/sanka_cli/mcp/server.py +0 -210
- sanka_cli-0.2.7/src/sanka_connector/registration.py +0 -38
- sanka_cli-0.2.7/tests/test_mcp.py +0 -90
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/.gitignore +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/LICENSES/AGPL-3.0-only.txt +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/LICENSES/Apache-2.0.txt +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/NOTICE +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/cli/_compact.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/cli/_output.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/cli/_research.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/cli/py.typed +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/connector/__init__.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/connector/py.typed +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/__about__.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/concurrency.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/execution/__init__.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/execution/continuous.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/execution/errors.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/execution/local.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/execution/state.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/extensions/__init__.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/hashing.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/mapping/__init__.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/mapping/errors.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/private_sqlite.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/py.typed +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/safe_local_io.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka/runtime/spec.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/__main__.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/bundle.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/certificates.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/client.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/commands/__init__.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/commands/ai.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/commands/auth.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/commands/cloud.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/commands/cloud_fleet.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/commands/cloud_migrate.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/commands/profiles.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/commands/resources.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/commands/skill.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/commands/workflows.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/config.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/output.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/runtime.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_cli/state.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_connector/py.typed +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/src/sanka_connector/records.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/fixtures/extension_drf_project/api/__init__.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/fixtures/extension_drf_project/api/serializers.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/fixtures/extension_drf_project/api/views.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/fixtures/extension_drf_project/config/__init__.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/fixtures/extension_drf_project/config/settings.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/fixtures/extension_drf_project/config/urls.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/fixtures/extension_drf_project/manage.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/fixtures/extension_marketplace/drf-to-fastapi.json +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/fixtures/extension_marketplace/marketplace.json +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_cli_developer_experience.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_code_bundle.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_concurrency.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_execution_continuous.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_execution_local_store.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_execution_report_codec.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_extension_discovery.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_extension_lifecycle.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_extension_runner.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_extension_wheel_acceptance.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_hashing.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_safe_local_io.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_skill_commands.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_spec.py +0 -0
- {sanka_cli-0.2.7 → sanka_cli-0.2.9}/tests/test_state_store.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sanka-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
4
4
|
Summary: Sanka command-line interface and migration runtime
|
|
5
5
|
Project-URL: Repository, https://github.com/sankaHQ/sanka
|
|
6
6
|
Project-URL: Issues, https://github.com/sankaHQ/sanka/issues
|
|
@@ -23,10 +23,6 @@ Requires-Dist: packaging<27,>=24
|
|
|
23
23
|
Requires-Dist: platformdirs<5,>=4
|
|
24
24
|
Requires-Dist: pyyaml>=6
|
|
25
25
|
Requires-Dist: rich<15,>=13
|
|
26
|
-
Provides-Extra: mcp
|
|
27
|
-
Requires-Dist: mcp<2,>=1.12; extra == 'mcp'
|
|
28
|
-
Requires-Dist: pydantic-settings<3,>=2.10; extra == 'mcp'
|
|
29
|
-
Requires-Dist: pydantic<3,>=2.11; extra == 'mcp'
|
|
30
26
|
Description-Content-Type: text/markdown
|
|
31
27
|
|
|
32
28
|
# sanka-cli
|
|
@@ -34,9 +30,9 @@ Description-Content-Type: text/markdown
|
|
|
34
30
|
`sanka-cli` is Sanka's single Python distribution. It installs one `sanka`
|
|
35
31
|
executable and contains:
|
|
36
32
|
|
|
37
|
-
- the Apache-2.0 hosted command dispatcher, authentication, output
|
|
38
|
-
|
|
39
|
-
- the embedded Apache-2.0
|
|
33
|
+
- the Apache-2.0 hosted command dispatcher, authentication, and output
|
|
34
|
+
under `sanka_cli`;
|
|
35
|
+
- the embedded Apache-2.0 Sanka Extension SDK through `sanka_extensions`; and
|
|
40
36
|
- the AGPL-3.0-only local migration runtime under `sanka`.
|
|
41
37
|
|
|
42
38
|
Python 3.12 or newer is required.
|
|
@@ -48,12 +44,8 @@ uv tool install sanka-cli
|
|
|
48
44
|
sanka --help
|
|
49
45
|
```
|
|
50
46
|
|
|
51
|
-
For the
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
uv tool install 'sanka-cli[mcp]'
|
|
55
|
-
sanka mcp
|
|
56
|
-
```
|
|
47
|
+
For AI agents using MCP, connect to the hosted Sanka MCP server at
|
|
48
|
+
`https://mcp.sanka.com/mcp`. No local MCP package is required.
|
|
57
49
|
|
|
58
50
|
Install the bundled `sanka-cli` skill into an AI coding harness:
|
|
59
51
|
|
|
@@ -108,6 +100,13 @@ workflows, AI, Custom Code, and explicitly cloud-selected migrations retain
|
|
|
108
100
|
their existing authentication requirements. Add `--json` to local lifecycle
|
|
109
101
|
commands for the stable `sanka-cli/v1` response envelope.
|
|
110
102
|
|
|
103
|
+
Custom functions use `sanka functions`; the old `sanka code` group keeps its original
|
|
104
|
+
function operations as a compatibility alias. Sanka Code migration commands remain
|
|
105
|
+
`scan`, `plan`, `apply`, `test`, and `verify`.
|
|
106
|
+
|
|
107
|
+
`--base-url` also selects the API origin for anonymous research/assessment. A full
|
|
108
|
+
migration-service URL in `SANKA_MIGRATE_API_BASE` is retained as a fallback.
|
|
109
|
+
|
|
111
110
|
## Hosted repository runs
|
|
112
111
|
|
|
113
112
|
`sanka cloud` uploads reviewed repository ZIPs, starts runs with an explicit
|
|
@@ -126,10 +125,10 @@ component/runtime compatibility, exact wheel URL and SHA-256 digest, package
|
|
|
126
125
|
metadata, entry points, and installed files. Project locks record the exact
|
|
127
126
|
snapshot and artifact identities in `.sanka/extensions.lock`.
|
|
128
127
|
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
Code extensions use the `sanka-extension/v1` subprocess protocol.
|
|
129
|
+
Extension implementations load only in an isolated child environment and are
|
|
131
130
|
proxied over `sanka-connector/v1`; provider code is never imported into the
|
|
132
|
-
main CLI process. Hosted
|
|
131
|
+
main CLI process. Hosted SaaS implementations remain private to the cloud runtime.
|
|
133
132
|
|
|
134
133
|
## Python facade
|
|
135
134
|
|
|
@@ -137,7 +136,7 @@ main CLI process. Hosted providers are not local connectors.
|
|
|
137
136
|
from sanka import Sanka
|
|
138
137
|
```
|
|
139
138
|
|
|
140
|
-
`Sanka.
|
|
139
|
+
`Sanka.configure_system(...)` creates a write-free endpoint descriptor.
|
|
141
140
|
`Sanka.migrate(...)` creates or resumes a local lifecycle handle. Planning is
|
|
142
141
|
destination-write-free, and apply requires the exact plan hash returned by
|
|
143
142
|
plan.
|
|
@@ -149,11 +148,26 @@ The Python and Node `sanka-sdk` migration adapters invoke
|
|
|
149
148
|
execution for local commands, require an API token, auto-install this package,
|
|
150
149
|
or replace its framework detection and safety defaults.
|
|
151
150
|
|
|
152
|
-
## MCP
|
|
151
|
+
## Hosted MCP
|
|
152
|
+
|
|
153
|
+
Configure an MCP client with the hosted server:
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"mcpServers": {
|
|
158
|
+
"sanka": { "url": "https://mcp.sanka.com/mcp" }
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Connect your Sanka account when prompted. Hosted operations follow their
|
|
164
|
+
normal permissions and usage pricing.
|
|
153
165
|
|
|
154
|
-
`
|
|
155
|
-
`
|
|
156
|
-
|
|
166
|
+
The local research MCP server and the `mcp` installation extra were removed
|
|
167
|
+
in `sanka-cli` 0.2.9. Replace any `command: "sanka", args: ["mcp"]`
|
|
168
|
+
configuration with the hosted URL above. The old command exits with a
|
|
169
|
+
retirement message; it does not start a server or make a network request.
|
|
170
|
+
Local migration commands and SDK adapters continue to use the CLI.
|
|
157
171
|
|
|
158
172
|
## License
|
|
159
173
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
`sanka-cli` is Sanka's single Python distribution. It installs one `sanka`
|
|
4
4
|
executable and contains:
|
|
5
5
|
|
|
6
|
-
- the Apache-2.0 hosted command dispatcher, authentication, output
|
|
7
|
-
|
|
8
|
-
- the embedded Apache-2.0
|
|
6
|
+
- the Apache-2.0 hosted command dispatcher, authentication, and output
|
|
7
|
+
under `sanka_cli`;
|
|
8
|
+
- the embedded Apache-2.0 Sanka Extension SDK through `sanka_extensions`; and
|
|
9
9
|
- the AGPL-3.0-only local migration runtime under `sanka`.
|
|
10
10
|
|
|
11
11
|
Python 3.12 or newer is required.
|
|
@@ -17,12 +17,8 @@ uv tool install sanka-cli
|
|
|
17
17
|
sanka --help
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
For the
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
uv tool install 'sanka-cli[mcp]'
|
|
24
|
-
sanka mcp
|
|
25
|
-
```
|
|
20
|
+
For AI agents using MCP, connect to the hosted Sanka MCP server at
|
|
21
|
+
`https://mcp.sanka.com/mcp`. No local MCP package is required.
|
|
26
22
|
|
|
27
23
|
Install the bundled `sanka-cli` skill into an AI coding harness:
|
|
28
24
|
|
|
@@ -77,6 +73,13 @@ workflows, AI, Custom Code, and explicitly cloud-selected migrations retain
|
|
|
77
73
|
their existing authentication requirements. Add `--json` to local lifecycle
|
|
78
74
|
commands for the stable `sanka-cli/v1` response envelope.
|
|
79
75
|
|
|
76
|
+
Custom functions use `sanka functions`; the old `sanka code` group keeps its original
|
|
77
|
+
function operations as a compatibility alias. Sanka Code migration commands remain
|
|
78
|
+
`scan`, `plan`, `apply`, `test`, and `verify`.
|
|
79
|
+
|
|
80
|
+
`--base-url` also selects the API origin for anonymous research/assessment. A full
|
|
81
|
+
migration-service URL in `SANKA_MIGRATE_API_BASE` is retained as a fallback.
|
|
82
|
+
|
|
80
83
|
## Hosted repository runs
|
|
81
84
|
|
|
82
85
|
`sanka cloud` uploads reviewed repository ZIPs, starts runs with an explicit
|
|
@@ -95,10 +98,10 @@ component/runtime compatibility, exact wheel URL and SHA-256 digest, package
|
|
|
95
98
|
metadata, entry points, and installed files. Project locks record the exact
|
|
96
99
|
snapshot and artifact identities in `.sanka/extensions.lock`.
|
|
97
100
|
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
Code extensions use the `sanka-extension/v1` subprocess protocol.
|
|
102
|
+
Extension implementations load only in an isolated child environment and are
|
|
100
103
|
proxied over `sanka-connector/v1`; provider code is never imported into the
|
|
101
|
-
main CLI process. Hosted
|
|
104
|
+
main CLI process. Hosted SaaS implementations remain private to the cloud runtime.
|
|
102
105
|
|
|
103
106
|
## Python facade
|
|
104
107
|
|
|
@@ -106,7 +109,7 @@ main CLI process. Hosted providers are not local connectors.
|
|
|
106
109
|
from sanka import Sanka
|
|
107
110
|
```
|
|
108
111
|
|
|
109
|
-
`Sanka.
|
|
112
|
+
`Sanka.configure_system(...)` creates a write-free endpoint descriptor.
|
|
110
113
|
`Sanka.migrate(...)` creates or resumes a local lifecycle handle. Planning is
|
|
111
114
|
destination-write-free, and apply requires the exact plan hash returned by
|
|
112
115
|
plan.
|
|
@@ -118,11 +121,26 @@ The Python and Node `sanka-sdk` migration adapters invoke
|
|
|
118
121
|
execution for local commands, require an API token, auto-install this package,
|
|
119
122
|
or replace its framework detection and safety defaults.
|
|
120
123
|
|
|
121
|
-
## MCP
|
|
124
|
+
## Hosted MCP
|
|
125
|
+
|
|
126
|
+
Configure an MCP client with the hosted server:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"mcpServers": {
|
|
131
|
+
"sanka": { "url": "https://mcp.sanka.com/mcp" }
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Connect your Sanka account when prompted. Hosted operations follow their
|
|
137
|
+
normal permissions and usage pricing.
|
|
122
138
|
|
|
123
|
-
`
|
|
124
|
-
`
|
|
125
|
-
|
|
139
|
+
The local research MCP server and the `mcp` installation extra were removed
|
|
140
|
+
in `sanka-cli` 0.2.9. Replace any `command: "sanka", args: ["mcp"]`
|
|
141
|
+
configuration with the hosted URL above. The old command exits with a
|
|
142
|
+
retirement message; it does not start a server or make a network request.
|
|
143
|
+
Local migration commands and SDK adapters continue to use the CLI.
|
|
126
144
|
|
|
127
145
|
## License
|
|
128
146
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "sanka-cli"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.9"
|
|
4
4
|
description = "Sanka command-line interface and migration runtime"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
@@ -25,9 +25,6 @@ dependencies = [
|
|
|
25
25
|
"rich>=13,<15",
|
|
26
26
|
]
|
|
27
27
|
|
|
28
|
-
[project.optional-dependencies]
|
|
29
|
-
mcp = ["mcp>=1.12,<2", "pydantic>=2.11,<3", "pydantic-settings>=2.10,<3"]
|
|
30
|
-
|
|
31
28
|
[project.scripts]
|
|
32
29
|
sanka = "sanka_cli.main:main"
|
|
33
30
|
|
|
@@ -43,5 +40,7 @@ build-backend = "hatchling.build"
|
|
|
43
40
|
packages = [
|
|
44
41
|
"src/sanka",
|
|
45
42
|
"src/sanka_cli",
|
|
43
|
+
"src/sanka_extensions",
|
|
46
44
|
"src/sanka_connector",
|
|
45
|
+
"src/sanka_extension_sdk",
|
|
47
46
|
]
|
|
@@ -6,16 +6,17 @@ Install the ``sanka-cli`` distribution, then start here::
|
|
|
6
6
|
from sanka import Sanka
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
from sanka._client import Connection, Migration, Sanka
|
|
9
|
+
from sanka._client import Connection, DataEndpoint, Migration, Sanka, SystemConfig
|
|
10
10
|
from sanka.runtime.__about__ import __version__
|
|
11
11
|
from sanka.runtime.engine import ExecutionError, InspectionResult, PlanMismatchError, VerifyReport
|
|
12
12
|
from sanka.runtime.planner import MigrationPlan
|
|
13
|
-
from sanka.runtime.registry import UnknownConnectorError
|
|
13
|
+
from sanka.runtime.registry import UnknownConnectorError, UnknownEndpointError, UnknownSystemError
|
|
14
14
|
from sanka.runtime.spec import EndpointSpec, MigrationSpec, SpecError
|
|
15
15
|
from sanka.runtime.state import RunStatus
|
|
16
16
|
|
|
17
17
|
__all__ = [
|
|
18
18
|
"Connection",
|
|
19
|
+
"DataEndpoint",
|
|
19
20
|
"EndpointSpec",
|
|
20
21
|
"ExecutionError",
|
|
21
22
|
"InspectionResult",
|
|
@@ -26,7 +27,10 @@ __all__ = [
|
|
|
26
27
|
"RunStatus",
|
|
27
28
|
"Sanka",
|
|
28
29
|
"SpecError",
|
|
30
|
+
"SystemConfig",
|
|
29
31
|
"UnknownConnectorError",
|
|
32
|
+
"UnknownEndpointError",
|
|
33
|
+
"UnknownSystemError",
|
|
30
34
|
"VerifyReport",
|
|
31
35
|
"__version__",
|
|
32
36
|
]
|
|
@@ -12,36 +12,89 @@ from typing import Any
|
|
|
12
12
|
from sanka.runtime.engine import InspectionResult, MigrationEngine, VerifyReport
|
|
13
13
|
from sanka.runtime.execution import DEFAULT_VALIDATION_SAMPLE_SIZE
|
|
14
14
|
from sanka.runtime.planner import MigrationPlan
|
|
15
|
-
from sanka.runtime.registry import
|
|
15
|
+
from sanka.runtime.registry import ExtensionRegistry
|
|
16
16
|
from sanka.runtime.spec import EndpointSpec, MigrationSpec, SpecError
|
|
17
17
|
from sanka.runtime.state import RunStatus, SqliteStateStore
|
|
18
|
-
from
|
|
18
|
+
from sanka_extensions.data import CredentialProvider
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
22
|
-
class
|
|
23
|
-
"""A
|
|
21
|
+
@dataclass(frozen=True, slots=True, kw_only=True, init=False)
|
|
22
|
+
class DataEndpoint:
|
|
23
|
+
"""A data source or destination with independent, non-secret configuration.
|
|
24
24
|
|
|
25
|
-
Creating
|
|
26
|
-
|
|
27
|
-
:meth:`Sanka.migrate`. Authentication and reachability are evaluated by the
|
|
28
|
-
migration lifecycle, never while selecting the provider.
|
|
25
|
+
Creating this descriptor never authenticates an endpoint. Secret values stay
|
|
26
|
+
in environment variables or a managed credential store.
|
|
29
27
|
"""
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
endpoint_type: str
|
|
32
30
|
roles: tuple[str, ...]
|
|
33
|
-
|
|
31
|
+
endpoint_reference: str | None = None
|
|
34
32
|
options: Mapping[str, Any] = field(default_factory=dict)
|
|
35
33
|
|
|
34
|
+
def __init__(
|
|
35
|
+
self,
|
|
36
|
+
*,
|
|
37
|
+
endpoint_type: str | None = None,
|
|
38
|
+
system_type: str | None = None,
|
|
39
|
+
roles: tuple[str, ...],
|
|
40
|
+
endpoint_reference: str | None = None,
|
|
41
|
+
options: Mapping[str, Any] | None = None,
|
|
42
|
+
provider: str | None = None,
|
|
43
|
+
connection: str | None = None,
|
|
44
|
+
) -> None:
|
|
45
|
+
# Old Connection keyword arguments remain accepted without silently
|
|
46
|
+
# choosing one endpoint when a caller supplies conflicting identities.
|
|
47
|
+
if system_type is not None and provider is not None and system_type != provider:
|
|
48
|
+
raise ValueError("system_type and compatibility provider disagree")
|
|
49
|
+
compatibility_type = system_type if system_type is not None else provider
|
|
50
|
+
if (
|
|
51
|
+
endpoint_type is not None
|
|
52
|
+
and compatibility_type is not None
|
|
53
|
+
and endpoint_type != compatibility_type
|
|
54
|
+
):
|
|
55
|
+
raise ValueError("endpoint_type and compatibility type disagree")
|
|
56
|
+
if (
|
|
57
|
+
endpoint_reference is not None
|
|
58
|
+
and connection is not None
|
|
59
|
+
and endpoint_reference != connection
|
|
60
|
+
):
|
|
61
|
+
raise ValueError("endpoint_reference and compatibility connection disagree")
|
|
62
|
+
selected_type = endpoint_type if endpoint_type is not None else compatibility_type
|
|
63
|
+
if selected_type is None or not selected_type.strip():
|
|
64
|
+
raise ValueError("endpoint_type is required")
|
|
65
|
+
object.__setattr__(self, "endpoint_type", selected_type)
|
|
66
|
+
object.__setattr__(self, "roles", roles)
|
|
67
|
+
object.__setattr__(
|
|
68
|
+
self,
|
|
69
|
+
"endpoint_reference",
|
|
70
|
+
endpoint_reference if endpoint_reference is not None else connection,
|
|
71
|
+
)
|
|
72
|
+
object.__setattr__(self, "options", dict(options or {}))
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def provider(self) -> str:
|
|
76
|
+
"""Compatibility spelling for endpoint_type."""
|
|
77
|
+
return self.endpoint_type
|
|
78
|
+
|
|
79
|
+
@property
|
|
80
|
+
def system_type(self) -> str:
|
|
81
|
+
"""Compatibility spelling for endpoint_type."""
|
|
82
|
+
return self.endpoint_type
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def connection(self) -> str | None:
|
|
86
|
+
"""Compatibility spelling for endpoint_reference."""
|
|
87
|
+
return self.endpoint_reference
|
|
88
|
+
|
|
36
89
|
def endpoint(self) -> EndpointSpec:
|
|
37
90
|
return EndpointSpec(
|
|
38
|
-
type=self.
|
|
39
|
-
connection=self.
|
|
91
|
+
type=self.endpoint_type,
|
|
92
|
+
connection=self.endpoint_reference,
|
|
40
93
|
options=dict(self.options),
|
|
41
94
|
)
|
|
42
95
|
|
|
43
96
|
|
|
44
|
-
EndpointInput = str | Path | EndpointSpec |
|
|
97
|
+
EndpointInput = str | Path | EndpointSpec | DataEndpoint
|
|
45
98
|
|
|
46
99
|
|
|
47
100
|
class Migration:
|
|
@@ -106,7 +159,7 @@ class Sanka:
|
|
|
106
159
|
credential_provider: CredentialProvider | None = None,
|
|
107
160
|
) -> None:
|
|
108
161
|
self._store = SqliteStateStore(state)
|
|
109
|
-
self._registry =
|
|
162
|
+
self._registry = ExtensionRegistry.discover()
|
|
110
163
|
self._engine = MigrationEngine(
|
|
111
164
|
store=self._store,
|
|
112
165
|
registry=self._registry,
|
|
@@ -116,32 +169,50 @@ class Sanka:
|
|
|
116
169
|
)
|
|
117
170
|
self._closed = False
|
|
118
171
|
|
|
119
|
-
def
|
|
172
|
+
def configure_endpoint(
|
|
120
173
|
self,
|
|
121
|
-
|
|
122
|
-
|
|
174
|
+
endpoint_type: str,
|
|
175
|
+
endpoint_reference: str | Path | None = None,
|
|
123
176
|
*,
|
|
124
177
|
options: Mapping[str, Any] | None = None,
|
|
125
|
-
) ->
|
|
126
|
-
"""
|
|
178
|
+
) -> DataEndpoint:
|
|
179
|
+
"""Configure a data endpoint supported by an installed extension.
|
|
127
180
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
store; the resulting descriptor may be persisted in a migration spec.
|
|
181
|
+
The endpoint reference is a path, URL, or named data endpoint.
|
|
182
|
+
Authentication and reachability are checked by the migration lifecycle.
|
|
131
183
|
"""
|
|
132
184
|
self._ensure_open()
|
|
133
|
-
normalized =
|
|
185
|
+
normalized = endpoint_type.strip().lower()
|
|
134
186
|
if normalized == "postgresql":
|
|
135
187
|
normalized = "postgres"
|
|
136
188
|
roles = self._registry.roles(normalized)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
provider=normalized,
|
|
189
|
+
return DataEndpoint(
|
|
190
|
+
endpoint_type=normalized,
|
|
140
191
|
roles=roles,
|
|
141
|
-
|
|
142
|
-
options=
|
|
192
|
+
endpoint_reference=None if endpoint_reference is None else str(endpoint_reference),
|
|
193
|
+
options=options,
|
|
143
194
|
)
|
|
144
195
|
|
|
196
|
+
def configure_system(
|
|
197
|
+
self,
|
|
198
|
+
system_type: str,
|
|
199
|
+
endpoint_reference: str | Path | None = None,
|
|
200
|
+
*,
|
|
201
|
+
options: Mapping[str, Any] | None = None,
|
|
202
|
+
) -> DataEndpoint:
|
|
203
|
+
"""Compatibility method for configure_endpoint; does not authenticate."""
|
|
204
|
+
return self.configure_endpoint(system_type, endpoint_reference, options=options)
|
|
205
|
+
|
|
206
|
+
def connect(
|
|
207
|
+
self,
|
|
208
|
+
provider: str,
|
|
209
|
+
connection: str | Path | None = None,
|
|
210
|
+
*,
|
|
211
|
+
options: Mapping[str, Any] | None = None,
|
|
212
|
+
) -> DataEndpoint:
|
|
213
|
+
"""Compatibility method for configure_endpoint; does not authenticate."""
|
|
214
|
+
return self.configure_endpoint(provider, connection, options=options)
|
|
215
|
+
|
|
145
216
|
def migrate(
|
|
146
217
|
self,
|
|
147
218
|
source: EndpointInput,
|
|
@@ -194,7 +265,7 @@ class Sanka:
|
|
|
194
265
|
|
|
195
266
|
|
|
196
267
|
def _endpoint(value: EndpointInput, *, role: str) -> EndpointSpec:
|
|
197
|
-
if isinstance(value,
|
|
268
|
+
if isinstance(value, DataEndpoint):
|
|
198
269
|
return value.endpoint()
|
|
199
270
|
if isinstance(value, EndpointSpec):
|
|
200
271
|
return value
|
|
@@ -218,6 +289,13 @@ def _endpoint(value: EndpointInput, *, role: str) -> EndpointSpec:
|
|
|
218
289
|
return EndpointSpec(type="sqlite", connection=str(path))
|
|
219
290
|
|
|
220
291
|
raise SpecError(
|
|
221
|
-
f"cannot infer the {role}
|
|
292
|
+
f"cannot infer the {role} system type from {raw!r}; pass an EndpointSpec, "
|
|
222
293
|
"a URL-style endpoint, or a supported local path"
|
|
223
294
|
)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
# Compatibility import for clients using the original descriptor name.
|
|
298
|
+
Connection = DataEndpoint
|
|
299
|
+
|
|
300
|
+
# Compatibility names from the earlier systems terminology.
|
|
301
|
+
SystemConfig = DataEndpoint
|
|
@@ -55,7 +55,7 @@ from sanka.runtime.extensions.lifecycle import ApplicationLifecycle
|
|
|
55
55
|
from sanka.runtime.extensions.runner import ExtensionResult
|
|
56
56
|
from sanka.runtime.extensions.store import ExtensionStore
|
|
57
57
|
from sanka.runtime.planner import MigrationPlan
|
|
58
|
-
from sanka.runtime.registry import
|
|
58
|
+
from sanka.runtime.registry import ExtensionRegistry, UnknownEndpointError
|
|
59
59
|
from sanka.runtime.spec import EndpointSpec, MigrationSpec, SpecError
|
|
60
60
|
from sanka.runtime.state import SqliteStateStore
|
|
61
61
|
|
|
@@ -83,12 +83,13 @@ class _CliArgumentParser(argparse.ArgumentParser):
|
|
|
83
83
|
super().error(message)
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
def main(argv: list[str] | None = None) -> int:
|
|
86
|
+
def main(argv: list[str] | None = None, *, api_base: str | None = None) -> int:
|
|
87
87
|
arguments = list(sys.argv[1:] if argv is None else argv)
|
|
88
88
|
json_errors = "--json" in arguments or "--compact-dsl" in arguments
|
|
89
89
|
parser = _build_parser(json_errors=json_errors)
|
|
90
90
|
try:
|
|
91
91
|
args = parser.parse_args(arguments)
|
|
92
|
+
args.api_base = api_base
|
|
92
93
|
except CliUsageError as error:
|
|
93
94
|
command = arguments[0] if arguments and arguments[0] in SDK_COMMANDS else "sanka"
|
|
94
95
|
return _print_cli_error(
|
|
@@ -121,7 +122,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
121
122
|
)
|
|
122
123
|
except (
|
|
123
124
|
SpecError,
|
|
124
|
-
|
|
125
|
+
UnknownEndpointError,
|
|
125
126
|
ExecutionError,
|
|
126
127
|
FileNotFoundError,
|
|
127
128
|
) as error:
|
|
@@ -400,7 +401,7 @@ def _build_parser(*, json_errors: bool = False) -> argparse.ArgumentParser:
|
|
|
400
401
|
|
|
401
402
|
test = commands.add_parser(
|
|
402
403
|
"test",
|
|
403
|
-
help="generate and run
|
|
404
|
+
help="generate and run tests for the converted application",
|
|
404
405
|
description=(
|
|
405
406
|
"Prepare the generated uv or pip environment, write generated-app tests, and run "
|
|
406
407
|
"them. This proves generated scope, not source parity."
|
|
@@ -550,9 +551,9 @@ def _build_parser(*, json_errors: bool = False) -> argparse.ArgumentParser:
|
|
|
550
551
|
|
|
551
552
|
connect = commands.add_parser(
|
|
552
553
|
"connect",
|
|
553
|
-
help="
|
|
554
|
+
help="inspect installed extension support; does not authenticate a system",
|
|
554
555
|
)
|
|
555
|
-
connect.add_argument("provider", help="
|
|
556
|
+
connect.add_argument("provider", help="system type, e.g. markdown or postgres")
|
|
556
557
|
connect.add_argument("--json", action="store_true", help="print provider details as JSON")
|
|
557
558
|
connect.set_defaults(handler=_cmd_connect)
|
|
558
559
|
|
|
@@ -626,6 +627,9 @@ def _build_parser(*, json_errors: bool = False) -> argparse.ArgumentParser:
|
|
|
626
627
|
marketplace_add = marketplace_commands.add_parser("add", help="add a trusted snapshot")
|
|
627
628
|
marketplace_add.add_argument("source")
|
|
628
629
|
marketplace_add.add_argument("--name")
|
|
630
|
+
marketplace_add.add_argument(
|
|
631
|
+
"--revision", help="pin an explicit full Git commit instead of the default catalog"
|
|
632
|
+
)
|
|
629
633
|
marketplace_add.add_argument(
|
|
630
634
|
"--trust", action="store_true", help="explicitly trust a third-party source"
|
|
631
635
|
)
|
|
@@ -668,13 +672,20 @@ def _research_output_options(parser: argparse.ArgumentParser) -> None:
|
|
|
668
672
|
parser.add_argument("--json", action="store_true", help="print the API data payload as JSON")
|
|
669
673
|
|
|
670
674
|
|
|
671
|
-
def _research_client() -> SankaMigrateApiClient:
|
|
675
|
+
def _research_client(api_base: str | None = None) -> SankaMigrateApiClient:
|
|
676
|
+
# The shared CLI option names an API origin (optionally with a path prefix).
|
|
677
|
+
# The older SANKA_MIGRATE_API_BASE setting continues to name the full service root.
|
|
678
|
+
if api_base:
|
|
679
|
+
base = api_base.rstrip("/")
|
|
680
|
+
if not base.endswith("/v2/migrate"):
|
|
681
|
+
base += "/v2/migrate"
|
|
682
|
+
return SankaMigrateApiClient(base_url=base)
|
|
672
683
|
return SankaMigrateApiClient()
|
|
673
684
|
|
|
674
685
|
|
|
675
686
|
def _engine(state_path: str) -> MigrationEngine:
|
|
676
687
|
return MigrationEngine(
|
|
677
|
-
store=SqliteStateStore(state_path), registry=
|
|
688
|
+
store=SqliteStateStore(state_path), registry=ExtensionRegistry.discover()
|
|
678
689
|
)
|
|
679
690
|
|
|
680
691
|
|
|
@@ -696,7 +707,9 @@ def _extension_result(
|
|
|
696
707
|
[
|
|
697
708
|
(
|
|
698
709
|
str(record.get("id", "")),
|
|
699
|
-
|
|
710
|
+
{"connector": "System access", "migration": "Code conversion"}.get(
|
|
711
|
+
str(record.get("kind", "")), str(record.get("kind", ""))
|
|
712
|
+
),
|
|
700
713
|
str(record.get("version", "")),
|
|
701
714
|
", ".join(map(str, record.get("status", []))),
|
|
702
715
|
str(record.get("marketplace", "")),
|
|
@@ -772,6 +785,7 @@ async def _cmd_extension_marketplace_add(args: argparse.Namespace) -> int:
|
|
|
772
785
|
args.source,
|
|
773
786
|
name=args.name,
|
|
774
787
|
trust=args.trust,
|
|
788
|
+
revision=args.revision,
|
|
775
789
|
)
|
|
776
790
|
return _extension_result(args, "marketplace_add", [record.to_dict()])
|
|
777
791
|
|
|
@@ -791,22 +805,29 @@ async def _cmd_extension_marketplace_remove(args: argparse.Namespace) -> int:
|
|
|
791
805
|
|
|
792
806
|
|
|
793
807
|
async def _cmd_connect(args: argparse.Namespace) -> int:
|
|
794
|
-
registry =
|
|
795
|
-
|
|
796
|
-
if
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
808
|
+
registry = ExtensionRegistry.discover()
|
|
809
|
+
system_type = str(args.provider).strip().lower()
|
|
810
|
+
if system_type == "postgresql":
|
|
811
|
+
system_type = "postgres"
|
|
812
|
+
try:
|
|
813
|
+
roles = list(registry.roles(system_type))
|
|
814
|
+
payload = {
|
|
815
|
+
"provider": system_type, # Compatibility JSON key.
|
|
816
|
+
"system_type": system_type,
|
|
817
|
+
"roles": roles,
|
|
818
|
+
"installed": True,
|
|
819
|
+
"connection_status": "not_checked",
|
|
820
|
+
**registry.extension_metadata(system_type),
|
|
821
|
+
}
|
|
822
|
+
finally:
|
|
823
|
+
registry.close()
|
|
805
824
|
if args.json:
|
|
806
825
|
print(json.dumps(payload, ensure_ascii=False, indent=2))
|
|
807
826
|
else:
|
|
808
|
-
print(f"{
|
|
809
|
-
|
|
827
|
+
print(f"{system_type}: extension installed ({', '.join(roles)})")
|
|
828
|
+
if payload.get("package"):
|
|
829
|
+
print(f"extension {payload['extension_id']}; package {payload['package']}")
|
|
830
|
+
print("System authentication and reachability have not been checked.")
|
|
810
831
|
return 0
|
|
811
832
|
|
|
812
833
|
|
|
@@ -1149,7 +1170,7 @@ async def _cmd_migrate(args: argparse.Namespace) -> int:
|
|
|
1149
1170
|
|
|
1150
1171
|
async def _cmd_research_eol(args: argparse.Namespace) -> int:
|
|
1151
1172
|
data = await asyncio.to_thread(
|
|
1152
|
-
_research_client().research_eol,
|
|
1173
|
+
_research_client(getattr(args, "api_base", None)).research_eol,
|
|
1153
1174
|
product=args.product,
|
|
1154
1175
|
category=args.category,
|
|
1155
1176
|
event_type=args.type,
|
|
@@ -1162,7 +1183,7 @@ async def _cmd_research_eol(args: argparse.Namespace) -> int:
|
|
|
1162
1183
|
|
|
1163
1184
|
async def _cmd_research_tco(args: argparse.Namespace) -> int:
|
|
1164
1185
|
data = await asyncio.to_thread(
|
|
1165
|
-
_research_client().research_tco,
|
|
1186
|
+
_research_client(getattr(args, "api_base", None)).research_tco,
|
|
1166
1187
|
product=args.product,
|
|
1167
1188
|
category=args.category,
|
|
1168
1189
|
locale=args.locale,
|
|
@@ -1177,7 +1198,7 @@ async def _cmd_research_compare(args: argparse.Namespace) -> int:
|
|
|
1177
1198
|
"--platforms accepts at most 10 comma-separated values.",
|
|
1178
1199
|
)
|
|
1179
1200
|
data = await asyncio.to_thread(
|
|
1180
|
-
_research_client().research_compare,
|
|
1201
|
+
_research_client(getattr(args, "api_base", None)).research_compare,
|
|
1181
1202
|
category=args.category,
|
|
1182
1203
|
platforms=args.platforms,
|
|
1183
1204
|
locale=args.locale,
|
|
@@ -1209,7 +1230,7 @@ async def _cmd_assess(args: argparse.Namespace) -> int:
|
|
|
1209
1230
|
if elapsed_ms < 2000:
|
|
1210
1231
|
await asyncio.sleep((2000 - elapsed_ms) / 1000)
|
|
1211
1232
|
data = await asyncio.to_thread(
|
|
1212
|
-
_research_client().assess,
|
|
1233
|
+
_research_client(getattr(args, "api_base", None)).assess,
|
|
1213
1234
|
{
|
|
1214
1235
|
"source": args.source,
|
|
1215
1236
|
"destination": args.destination or "",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"""Sanka Runtime — planner, engine, state, and verification.
|
|
3
3
|
|
|
4
4
|
Everything under ``sanka.runtime`` is AGPL-3.0-only. Connectors must not
|
|
5
|
-
import this package; they depend on the Apache-2.0 ``
|
|
5
|
+
import this package; they depend on the Apache-2.0 ``sanka_extensions.data`` SPI
|
|
6
6
|
instead, and CI enforces that boundary.
|
|
7
7
|
|
|
8
8
|
The runtime lands in Phase 2 (lifecycle state machine, SQLite state store,
|