monosmith-plugin-sdk 0.1.1__tar.gz → 0.2.0__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.

Potentially problematic release.


This version of monosmith-plugin-sdk might be problematic. Click here for more details.

Files changed (95) hide show
  1. {monosmith_plugin_sdk-0.1.1/src/monosmith_plugin_sdk.egg-info → monosmith_plugin_sdk-0.2.0}/PKG-INFO +1 -1
  2. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/pyproject.toml +1 -1
  3. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/__init__.py +2 -0
  4. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/protocol/protocol_schema_contract.py +73 -0
  5. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/protocol/protocol_types_contract.py +62 -2
  6. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/__init__.py +2 -0
  7. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/plugin_contract.py +8 -0
  8. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/plugin_members_config.py +1 -0
  9. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0/src/monosmith_plugin_sdk.egg-info}/PKG-INFO +1 -1
  10. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/LICENSE +0 -0
  11. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/README.md +0 -0
  12. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/setup.cfg +0 -0
  13. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/build_dir/__init__.py +0 -0
  14. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/build_dir/build_dir_algorithm.py +0 -0
  15. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/cancellation/__init__.py +0 -0
  16. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/cancellation/cancel_token_model.py +0 -0
  17. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/cancellation/request_cancelled_error.py +0 -0
  18. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/ci/__init__.py +0 -0
  19. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/ci/ci_contribution_algorithm.py +0 -0
  20. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/codec/__init__.py +0 -0
  21. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/codec/encode_by_schema_algorithm.py +0 -0
  22. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/codec/encode_error.py +0 -0
  23. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/codec/encode_json_value_algorithm.py +0 -0
  24. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/codec/message_parse_error.py +0 -0
  25. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/codec/method_codec_algorithm.py +0 -0
  26. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/codec/normalize_by_schema_algorithm.py +0 -0
  27. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/codec/params_error.py +0 -0
  28. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/codec/received_message_contract.py +0 -0
  29. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/codec/schema_lookup_algorithm.py +0 -0
  30. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/codec/wire_message_mapper.py +0 -0
  31. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/concurrency/__init__.py +0 -0
  32. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/concurrency/concurrency_policy.py +0 -0
  33. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/conformance/__init__.py +0 -0
  34. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/conformance/check_generation_use_case.py +0 -0
  35. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/conformance/check_plugin_use_case.py +0 -0
  36. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/conformance/check_scheduling_use_case.py +0 -0
  37. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/conformance/conformance_report_model.py +0 -0
  38. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/conformance/find_manifests_algorithm.py +0 -0
  39. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/conformance/go_list_mapper.py +0 -0
  40. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/framing/__init__.py +0 -0
  41. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/framing/frame_message_algorithm.py +0 -0
  42. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/framing/frame_reader_store.py +0 -0
  43. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/framing/framing_error.py +0 -0
  44. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/host/__init__.py +0 -0
  45. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/host/call_interrupted_error.py +0 -0
  46. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/host/connect_plugin_use_case.py +0 -0
  47. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/host/host_options_contract.py +0 -0
  48. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/host/plugin_client_client.py +0 -0
  49. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/host/start_plugin_use_case.py +0 -0
  50. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/jsondoc/__init__.py +0 -0
  51. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/jsondoc/indent_raw_json_algorithm.py +0 -0
  52. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/jsondoc/json_document_error.py +0 -0
  53. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/jsondoc/json_document_model.py +0 -0
  54. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/jsondoc/scan_json_object_algorithm.py +0 -0
  55. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/plugin_refs/__init__.py +0 -0
  56. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/plugin_refs/plugin_ref_policy.py +0 -0
  57. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/plugin_roles/__init__.py +0 -0
  58. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/plugin_roles/plugin_role_policy.py +0 -0
  59. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/projects/__init__.py +0 -0
  60. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/projects/audit_settings_policy.py +0 -0
  61. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/projects/manifest_match_algorithm.py +0 -0
  62. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/projects/project_kind_policy.py +0 -0
  63. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/projects/publishes_policy.py +0 -0
  64. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/projects/set_toolchain_algorithm.py +0 -0
  65. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/projects/stack_plugins_algorithm.py +0 -0
  66. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/protocol/__init__.py +0 -0
  67. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/protocol/rpc_error.py +0 -0
  68. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/py.typed +0 -0
  69. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/scaffold/__init__.py +0 -0
  70. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/scaffold/scaffold_data_mapper.py +0 -0
  71. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/scaffold/scaffold_project_use_case.py +0 -0
  72. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/capabilities_of_algorithm.py +0 -0
  73. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/claim_stdio_use_case.py +0 -0
  74. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/dispatch_request_use_case.py +0 -0
  75. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/frame_writer_store.py +0 -0
  76. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/initialize_plugin_use_case.py +0 -0
  77. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/protocol_streams_contract.py +0 -0
  78. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/request_outcome_contract.py +0 -0
  79. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/request_pool_store.py +0 -0
  80. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/serve/serve_use_case.py +0 -0
  81. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/tasks/__init__.py +0 -0
  82. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/tasks/contribute_tasks_algorithm.py +0 -0
  83. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/tasks/task_algorithm.py +0 -0
  84. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/templating/__init__.py +0 -0
  85. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/templating/file_exists_error.py +0 -0
  86. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/templating/parse_template_algorithm.py +0 -0
  87. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/templating/render_template_algorithm.py +0 -0
  88. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/templating/template_error.py +0 -0
  89. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/templating/template_functions_algorithm.py +0 -0
  90. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/templating/template_syntax_contract.py +0 -0
  91. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/templating/tokenize_action_algorithm.py +0 -0
  92. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk/templating/write_templates_use_case.py +0 -0
  93. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk.egg-info/SOURCES.txt +0 -0
  94. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk.egg-info/dependency_links.txt +0 -0
  95. {monosmith_plugin_sdk-0.1.1 → monosmith_plugin_sdk-0.2.0}/src/monosmith_plugin_sdk.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: monosmith-plugin-sdk
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
4
  Summary: The Python SDK for writing smith plugins: the protocol's types, the serve loop, a test host, the conformance checks, templating and key-order-keeping JSON editing. No runtime dependencies.
5
5
  Author: Eduardo Russo
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "monosmith-plugin-sdk"
7
- version = "0.1.1"
7
+ version = "0.2.0"
8
8
  description = "The Python SDK for writing smith plugins: the protocol's types, the serve loop, a test host, the conformance checks, templating and key-order-keeping JSON editing. No runtime dependencies."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -97,6 +97,7 @@ from .serve import (
97
97
  Discoverer,
98
98
  DoctorContributor,
99
99
  Generator,
100
+ KindChanger,
100
101
  LatestReader,
101
102
  Plugin,
102
103
  Publisher,
@@ -124,6 +125,7 @@ __all__ = [
124
125
  "CIContributor",
125
126
  "DoctorContributor",
126
127
  "Remover",
128
+ "KindChanger",
127
129
  "DependencyManager",
128
130
  "DeclarationEditor",
129
131
  "LatestReader",
@@ -143,6 +143,17 @@ _SCHEMA_JSON = r'''{
143
143
  "capability": "remove",
144
144
  "notification": false
145
145
  },
146
+ "project/kind": {
147
+ "description": "Asks what changing a project between app, lib and package edits: its manifest, the workspace files and the dependents that name its kind or directory. The host applies the edits and moves the directory.",
148
+ "params": {
149
+ "$ref": "#/$defs/ChangeKindParams"
150
+ },
151
+ "result": {
152
+ "$ref": "#/$defs/ChangeKindResult"
153
+ },
154
+ "capability": "changeKind",
155
+ "notification": false
156
+ },
146
157
  "published": {
147
158
  "description": "Asks which version of a project its registry has, so a release can check its tags against it.",
148
159
  "params": {
@@ -509,6 +520,10 @@ _SCHEMA_JSON = r'''{
509
520
  "type": "boolean",
510
521
  "description": "Remove cleans up a removed project's traces outside its directory."
511
522
  },
523
+ "changeKind": {
524
+ "type": "boolean",
525
+ "description": "ChangeKind answers what changing a project's kind edits (smith kind)."
526
+ },
512
527
  "published": {
513
528
  "type": "boolean",
514
529
  "description": "Published reports what a registry has of a project."
@@ -531,6 +546,60 @@ _SCHEMA_JSON = r'''{
531
546
  }
532
547
  }
533
548
  },
549
+ "ChangeKindParams": {
550
+ "description": "ChangeKindParams asks a plugin what changing a project's kind edits. The plugin writes nothing: it answers with the files' new contents, and the host applies them, then moves the project's directory.",
551
+ "type": "object",
552
+ "properties": {
553
+ "project": {
554
+ "$ref": "#/$defs/Project",
555
+ "description": "Project is the project as it is now."
556
+ },
557
+ "to": {
558
+ "$ref": "#/$defs/ProjectKind",
559
+ "description": "To is the kind it becomes."
560
+ },
561
+ "newRoot": {
562
+ "type": "string",
563
+ "description": "NewRoot is the workspace-relative directory the host moves the project to afterwards; it equals Project.Root when the directory stays."
564
+ },
565
+ "projects": {
566
+ "type": "array",
567
+ "items": {
568
+ "$ref": "#/$defs/Project"
569
+ },
570
+ "description": "Projects are every project of the workspace, so the plugin can find the ones whose manifests and sources name this one."
571
+ }
572
+ },
573
+ "required": [
574
+ "project",
575
+ "to",
576
+ "newRoot"
577
+ ]
578
+ },
579
+ "ChangeKindResult": {
580
+ "description": "ChangeKindResult is what the change edits. Every path in Files is the path the file has before the move.",
581
+ "type": "object",
582
+ "properties": {
583
+ "refused": {
584
+ "type": "string",
585
+ "description": "Refused says why this kind makes no sense for the project's language (\"a Bicep template is deployed, never published\"); the host stops and shows it. Empty when the change is fine."
586
+ },
587
+ "files": {
588
+ "type": "array",
589
+ "items": {
590
+ "$ref": "#/$defs/FileEdit"
591
+ },
592
+ "description": "Files are the edits: manifests, workspace files and dependents that name the project's kind or its directory."
593
+ },
594
+ "warnings": {
595
+ "type": "array",
596
+ "items": {
597
+ "type": "string"
598
+ },
599
+ "description": "Warnings name what the change loses or leaves for the user (a binary an app has and a lib does not, a lockfile to refresh)."
600
+ }
601
+ }
602
+ },
534
603
  "ContributeParams": {
535
604
  "description": "ContributeParams hands a plugin the projects it applies to: those whose stack includes it, or, for a workspace-wide convention, those of the languages it supports that smith.toml enables it for.",
536
605
  "type": "object",
@@ -1353,6 +1422,10 @@ _SCHEMA_JSON = r'''{
1353
1422
  "registries": {
1354
1423
  "$ref": "#/$defs/Registries",
1355
1424
  "description": "Registries are the private registries the project installs from and publishes to, from smith.toml [registries]; nil means the public ones. Set by the host."
1425
+ },
1426
+ "releaseAssets": {
1427
+ "$ref": "#/$defs/AssetSpec",
1428
+ "description": "ReleaseAssets is what an app's release builds, from smith.toml [projects.<project>.release]: the platforms and file names, so a plugin can check (doctor) and prepare (CI) for them. Nil for a project that has no release files. Set by the host."
1356
1429
  }
1357
1430
  },
1358
1431
  "required": [
@@ -30,6 +30,8 @@ __all__ = [
30
30
  "CIResult",
31
31
  "CancelParams",
32
32
  "Capabilities",
33
+ "ChangeKindParams",
34
+ "ChangeKindResult",
33
35
  "ContributeParams",
34
36
  "ContributeResult",
35
37
  "Contribution",
@@ -149,11 +151,11 @@ class ErrorCodes:
149
151
  ERROR_CODES = ErrorCodes()
150
152
 
151
153
 
152
- MethodName = Literal["initialize", "shutdown", "cancel", "discover", "generate", "version/write", "publish", "ci", "doctor", "contribute", "remove", "published", "dependencies/install", "dependencies/uninstall", "dependencies/declared", "dependencies/rewrite", "dependencies/latest"]
154
+ MethodName = Literal["initialize", "shutdown", "cancel", "discover", "generate", "version/write", "publish", "ci", "doctor", "contribute", "remove", "project/kind", "published", "dependencies/install", "dependencies/uninstall", "dependencies/declared", "dependencies/rewrite", "dependencies/latest"]
153
155
  """Every method of the protocol, `initialize`, `shutdown` and the `cancel` notification too."""
154
156
 
155
157
 
156
- CapabilityName = Literal["discover", "generate", "version", "publish", "ci", "doctor", "contribute", "remove", "published", "dependencies", "declarations", "latest", "cancel"]
158
+ CapabilityName = Literal["discover", "generate", "version", "publish", "ci", "doctor", "contribute", "remove", "changeKind", "published", "dependencies", "declarations", "latest", "cancel"]
157
159
  """The names of the capability flags: the optional methods a plugin implements."""
158
160
 
159
161
 
@@ -169,6 +171,7 @@ METHOD_CAPABILITIES: Final[dict[str, str | None]] = {
169
171
  "doctor": "doctor",
170
172
  "contribute": "contribute",
171
173
  "remove": "remove",
174
+ "project/kind": "changeKind",
172
175
  "published": "published",
173
176
  "dependencies/install": "dependencies",
174
177
  "dependencies/uninstall": "dependencies",
@@ -312,6 +315,8 @@ class Capabilities(TypedDict, total=False):
312
315
  """Contribute is a convention plugin's: it adds tasks to projects other plugins discovered."""
313
316
  remove: bool
314
317
  """Remove cleans up a removed project's traces outside its directory."""
318
+ changeKind: bool
319
+ """ChangeKind answers what changing a project's kind edits (smith kind)."""
315
320
  published: bool
316
321
  """Published reports what a registry has of a project."""
317
322
  dependencies: bool
@@ -328,6 +333,55 @@ class Capabilities(TypedDict, total=False):
328
333
  """
329
334
 
330
335
 
336
+ class _ChangeKindParamsRequired(TypedDict):
337
+ project: Project
338
+ """Project is the project as it is now."""
339
+ to: ProjectKind
340
+ """To is the kind it becomes."""
341
+ newRoot: str
342
+ """
343
+ NewRoot is the workspace-relative directory the host moves the project to afterwards; it
344
+ equals Project.Root when the directory stays.
345
+ """
346
+
347
+
348
+ class ChangeKindParams(_ChangeKindParamsRequired, total=False):
349
+ """
350
+ ChangeKindParams asks a plugin what changing a project's kind edits. The plugin writes
351
+ nothing: it answers with the files' new contents, and the host applies them, then moves the
352
+ project's directory.
353
+ """
354
+
355
+ projects: list[Project]
356
+ """
357
+ Projects are every project of the workspace, so the plugin can find the ones whose manifests
358
+ and sources name this one.
359
+ """
360
+
361
+
362
+ class ChangeKindResult(TypedDict, total=False):
363
+ """
364
+ ChangeKindResult is what the change edits. Every path in Files is the path the file has
365
+ before the move.
366
+ """
367
+
368
+ refused: str
369
+ """
370
+ Refused says why this kind makes no sense for the project's language ("a Bicep template is
371
+ deployed, never published"); the host stops and shows it. Empty when the change is fine.
372
+ """
373
+ files: list[FileEdit]
374
+ """
375
+ Files are the edits: manifests, workspace files and dependents that name the project's kind
376
+ or its directory.
377
+ """
378
+ warnings: list[str]
379
+ """
380
+ Warnings name what the change loses or leaves for the user (a binary an app has and a lib
381
+ does not, a lockfile to refresh).
382
+ """
383
+
384
+
331
385
  class ContributeParams(TypedDict):
332
386
  """
333
387
  ContributeParams hands a plugin the projects it applies to: those whose stack includes it,
@@ -890,6 +944,12 @@ class Project(_ProjectRequired, total=False):
890
944
  Registries are the private registries the project installs from and publishes to, from
891
945
  smith.toml [registries]; nil means the public ones. Set by the host.
892
946
  """
947
+ releaseAssets: AssetSpec
948
+ """
949
+ ReleaseAssets is what an app's release builds, from smith.toml [projects.<project>.release]:
950
+ the platforms and file names, so a plugin can check (doctor) and prepare (CI) for them. Nil
951
+ for a project that has no release files. Set by the host.
952
+ """
893
953
 
894
954
 
895
955
  ProjectKind = Literal["app", "lib", "package"]
@@ -9,6 +9,7 @@ from .plugin_contract import (
9
9
  Discoverer,
10
10
  DoctorContributor,
11
11
  Generator,
12
+ KindChanger,
12
13
  LatestReader,
13
14
  Plugin,
14
15
  Publisher,
@@ -31,6 +32,7 @@ __all__ = [
31
32
  "Discoverer",
32
33
  "DoctorContributor",
33
34
  "Generator",
35
+ "KindChanger",
34
36
  "LatestReader",
35
37
  "Plugin",
36
38
  "Publisher",
@@ -17,6 +17,8 @@ from typing import Protocol
17
17
 
18
18
  from ..cancellation import CancelToken
19
19
  from ..protocol import (
20
+ ChangeKindParams,
21
+ ChangeKindResult,
20
22
  CIParams,
21
23
  CIResult,
22
24
  ContributeParams,
@@ -107,6 +109,12 @@ class Remover(Protocol):
107
109
  def remove(self, params: RemoveParams, cancel: CancelToken) -> RemoveResult: ...
108
110
 
109
111
 
112
+ class KindChanger(Protocol):
113
+ """`project/kind`: what changing a project between app, lib and package edits."""
114
+
115
+ def change_kind(self, params: ChangeKindParams, cancel: CancelToken) -> ChangeKindResult: ...
116
+
117
+
110
118
  class DependencyManager(Protocol):
111
119
  """`dependencies/install` and `dependencies/uninstall`: both, or the capability is not advertised."""
112
120
 
@@ -22,6 +22,7 @@ PLUGIN_MEMBERS: dict[str, PluginMember] = {
22
22
  "doctor": PluginMember("doctor", ("doctor",)),
23
23
  "contribute": PluginMember("contribute", ("contribute",)),
24
24
  "remove": PluginMember("remove", ("remove",)),
25
+ "project/kind": PluginMember("change_kind", ("change_kind",)),
25
26
  "published": PluginMember("published", ("published",)),
26
27
  "dependencies/install": PluginMember("install", ("install", "uninstall")),
27
28
  "dependencies/uninstall": PluginMember("uninstall", ("install", "uninstall")),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: monosmith-plugin-sdk
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
4
  Summary: The Python SDK for writing smith plugins: the protocol's types, the serve loop, a test host, the conformance checks, templating and key-order-keeping JSON editing. No runtime dependencies.
5
5
  Author: Eduardo Russo
6
6
  License-Expression: MIT