monosmith-plugin-sdk 0.2.0__tar.gz → 0.4.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 (96) hide show
  1. {monosmith_plugin_sdk-0.2.0/src/monosmith_plugin_sdk.egg-info → monosmith_plugin_sdk-0.4.0}/PKG-INFO +1 -1
  2. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/pyproject.toml +1 -1
  3. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/conformance/check_generation_use_case.py +6 -2
  4. monosmith_plugin_sdk-0.4.0/src/monosmith_plugin_sdk/conformance/check_kind_change_use_case.py +70 -0
  5. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/protocol/protocol_schema_contract.py +48 -0
  6. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/protocol/protocol_types_contract.py +49 -0
  7. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0/src/monosmith_plugin_sdk.egg-info}/PKG-INFO +1 -1
  8. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk.egg-info/SOURCES.txt +1 -0
  9. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/LICENSE +0 -0
  10. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/README.md +0 -0
  11. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/setup.cfg +0 -0
  12. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/__init__.py +0 -0
  13. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/build_dir/__init__.py +0 -0
  14. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/build_dir/build_dir_algorithm.py +0 -0
  15. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/cancellation/__init__.py +0 -0
  16. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/cancellation/cancel_token_model.py +0 -0
  17. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/cancellation/request_cancelled_error.py +0 -0
  18. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/ci/__init__.py +0 -0
  19. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/ci/ci_contribution_algorithm.py +0 -0
  20. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/codec/__init__.py +0 -0
  21. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/codec/encode_by_schema_algorithm.py +0 -0
  22. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/codec/encode_error.py +0 -0
  23. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/codec/encode_json_value_algorithm.py +0 -0
  24. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/codec/message_parse_error.py +0 -0
  25. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/codec/method_codec_algorithm.py +0 -0
  26. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/codec/normalize_by_schema_algorithm.py +0 -0
  27. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/codec/params_error.py +0 -0
  28. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/codec/received_message_contract.py +0 -0
  29. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/codec/schema_lookup_algorithm.py +0 -0
  30. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/codec/wire_message_mapper.py +0 -0
  31. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/concurrency/__init__.py +0 -0
  32. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/concurrency/concurrency_policy.py +0 -0
  33. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/conformance/__init__.py +0 -0
  34. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/conformance/check_plugin_use_case.py +0 -0
  35. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/conformance/check_scheduling_use_case.py +0 -0
  36. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/conformance/conformance_report_model.py +0 -0
  37. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/conformance/find_manifests_algorithm.py +0 -0
  38. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/conformance/go_list_mapper.py +0 -0
  39. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/framing/__init__.py +0 -0
  40. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/framing/frame_message_algorithm.py +0 -0
  41. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/framing/frame_reader_store.py +0 -0
  42. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/framing/framing_error.py +0 -0
  43. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/host/__init__.py +0 -0
  44. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/host/call_interrupted_error.py +0 -0
  45. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/host/connect_plugin_use_case.py +0 -0
  46. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/host/host_options_contract.py +0 -0
  47. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/host/plugin_client_client.py +0 -0
  48. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/host/start_plugin_use_case.py +0 -0
  49. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/jsondoc/__init__.py +0 -0
  50. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/jsondoc/indent_raw_json_algorithm.py +0 -0
  51. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/jsondoc/json_document_error.py +0 -0
  52. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/jsondoc/json_document_model.py +0 -0
  53. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/jsondoc/scan_json_object_algorithm.py +0 -0
  54. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/plugin_refs/__init__.py +0 -0
  55. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/plugin_refs/plugin_ref_policy.py +0 -0
  56. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/plugin_roles/__init__.py +0 -0
  57. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/plugin_roles/plugin_role_policy.py +0 -0
  58. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/projects/__init__.py +0 -0
  59. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/projects/audit_settings_policy.py +0 -0
  60. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/projects/manifest_match_algorithm.py +0 -0
  61. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/projects/project_kind_policy.py +0 -0
  62. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/projects/publishes_policy.py +0 -0
  63. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/projects/set_toolchain_algorithm.py +0 -0
  64. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/projects/stack_plugins_algorithm.py +0 -0
  65. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/protocol/__init__.py +0 -0
  66. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/protocol/rpc_error.py +0 -0
  67. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/py.typed +0 -0
  68. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/scaffold/__init__.py +0 -0
  69. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/scaffold/scaffold_data_mapper.py +0 -0
  70. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/scaffold/scaffold_project_use_case.py +0 -0
  71. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/__init__.py +0 -0
  72. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/capabilities_of_algorithm.py +0 -0
  73. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/claim_stdio_use_case.py +0 -0
  74. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/dispatch_request_use_case.py +0 -0
  75. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/frame_writer_store.py +0 -0
  76. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/initialize_plugin_use_case.py +0 -0
  77. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/plugin_contract.py +0 -0
  78. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/plugin_members_config.py +0 -0
  79. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/protocol_streams_contract.py +0 -0
  80. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/request_outcome_contract.py +0 -0
  81. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/request_pool_store.py +0 -0
  82. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/serve/serve_use_case.py +0 -0
  83. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/tasks/__init__.py +0 -0
  84. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/tasks/contribute_tasks_algorithm.py +0 -0
  85. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/tasks/task_algorithm.py +0 -0
  86. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/templating/__init__.py +0 -0
  87. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/templating/file_exists_error.py +0 -0
  88. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/templating/parse_template_algorithm.py +0 -0
  89. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/templating/render_template_algorithm.py +0 -0
  90. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/templating/template_error.py +0 -0
  91. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/templating/template_functions_algorithm.py +0 -0
  92. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/templating/template_syntax_contract.py +0 -0
  93. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/templating/tokenize_action_algorithm.py +0 -0
  94. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk/templating/write_templates_use_case.py +0 -0
  95. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.0}/src/monosmith_plugin_sdk.egg-info/dependency_links.txt +0 -0
  96. {monosmith_plugin_sdk-0.2.0 → monosmith_plugin_sdk-0.4.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.2.0
3
+ Version: 0.4.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.2.0"
7
+ version = "0.4.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"
@@ -11,6 +11,7 @@ from ..host import PluginClient
11
11
  from ..plugin_roles import effective_roles
12
12
  from ..projects import project_kind_directory
13
13
  from ..protocol import GenerateParams, Project, ProjectKind
14
+ from .check_kind_change_use_case import check_kind_change
14
15
  from .conformance_report_model import ConformanceReport
15
16
  from .find_manifests_algorithm import find_manifests
16
17
  from .go_list_mapper import go_list, go_quote
@@ -30,11 +31,12 @@ def check_generation(client: PluginClient, workspace: str | Path, report: Confor
30
31
 
31
32
  For a language plugin, also that its own `discover` returns what it made, with the kind and the
32
33
  stack it was asked for, tasks with commands, and that the dry runs of `version/write`, `remove`,
33
- `publish` and `published` answer.
34
+ `publish` and `published` answer, and, for a plugin that changes kinds, what `project/kind` edits.
34
35
  """
35
36
  language = "language" in effective_roles(client.info)
36
37
  made: list[GenerateParams] = []
37
- kinds: tuple[ProjectKind, ...] = ("app", "lib", "package")
38
+ declared = client.info.get("kinds") or []
39
+ kinds: tuple[ProjectKind, ...] = tuple(k for k in ("app", "lib", "package") if not declared or k in declared)
38
40
  for kind in kinds:
39
41
  name = f"c{kind}"
40
42
  params: GenerateParams = {
@@ -104,6 +106,8 @@ def check_generation(client: PluginClient, workspace: str | Path, report: Confor
104
106
  f"would remove the {kind} (dry run)",
105
107
  functools.partial(call, "remove", {"project": project, "dryRun": True}),
106
108
  )
109
+ if client.supports("project/kind"):
110
+ check_kind_change(client, workspace, project, projects, report)
107
111
  if kind == "package" and client.supports("publish"):
108
112
  publish = functools.partial(client.call, timeout=300.0)
109
113
  _attempt(
@@ -0,0 +1,70 @@
1
+ """The check of a plugin that changes kinds."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import posixpath
6
+ from collections.abc import Sequence
7
+ from pathlib import Path
8
+
9
+ from ..host import PluginClient
10
+ from ..projects import project_kind_directory
11
+ from ..protocol import Project, ProjectKind
12
+ from .conformance_report_model import ConformanceReport
13
+ from .find_manifests_algorithm import find_manifests
14
+ from .go_list_mapper import go_list
15
+
16
+
17
+ def _kind_change_target(kind: ProjectKind) -> ProjectKind:
18
+ """The kind a generated project is asked to become.
19
+
20
+ A lib is published as a package, an app becomes a lib, and a package goes back to a lib.
21
+ """
22
+ if kind == "app":
23
+ return "lib"
24
+ return "package" if kind == "lib" else "lib"
25
+
26
+
27
+ def _article(kind: ProjectKind) -> str:
28
+ return "an app" if kind == "app" else f"a {kind}"
29
+
30
+
31
+ def _snapshot(workspace: str | Path, names: Sequence[str]) -> dict[str, str]:
32
+ """The content of every manifest of the workspace, by path."""
33
+ paths = find_manifests(workspace, names)
34
+ return {path: Path(workspace, *path.split("/")).read_text(encoding="utf-8") for path in paths}
35
+
36
+
37
+ def check_kind_change(
38
+ client: PluginClient, workspace: str | Path, project: Project, projects: list[Project], report: ConformanceReport
39
+ ) -> None:
40
+ """Ask what making a generated project another kind edits.
41
+
42
+ The plugin must answer with a refusal or with edits to files that exist, and write nothing itself:
43
+ the host applies the edits.
44
+ """
45
+ to = _kind_change_target(project["kind"])
46
+ new_root = f"{project_kind_directory(to)}/{posixpath.basename(project['root'])}"
47
+ check = f"answers what making the {project['kind']} {_article(to)} edits (dry run)"
48
+ names = client.info.get("manifests") or []
49
+ before = _snapshot(workspace, names)
50
+ try:
51
+ answer = client.call(
52
+ "project/kind",
53
+ {"project": project, "to": to, "newRoot": new_root, "projects": projects},
54
+ timeout=300.0,
55
+ )
56
+ except Exception as error:
57
+ report.add(check, False, str(error))
58
+ return
59
+ files = answer.get("files") or []
60
+ missing = [f["path"] for f in files if not Path(workspace, *f["path"].split("/")).exists()]
61
+ if not answer.get("refused") and not files:
62
+ report.add(check, False, "it answered with neither a refusal nor an edit: a changed kind is recorded in a file")
63
+ elif missing:
64
+ report.add(check, False, f"edits files that do not exist (paths are those before the move): {go_list(missing)}")
65
+ else:
66
+ report.add(
67
+ check,
68
+ before == _snapshot(workspace, names),
69
+ "it wrote to the workspace: it must only answer with the new content, and let the host write it",
70
+ )
@@ -654,6 +654,10 @@ _SCHEMA_JSON = r'''{
654
654
  }
655
655
  },
656
656
  "description": "DependsOn adds dependencies to tasks the project already has, by task name ({\"lint\": [\"slice-check\"]})."
657
+ },
658
+ "release": {
659
+ "$ref": "#/$defs/ReleaseDefaults",
660
+ "description": "Release is how the project's release files are made, for a project that releases through GitHub releases and leaves them out of its smith.toml [projects.<name>.release] table; what the table sets wins."
657
661
  }
658
662
  }
659
663
  },
@@ -1175,6 +1179,13 @@ _SCHEMA_JSON = r'''{
1175
1179
  "$ref": "#/$defs/Stack"
1176
1180
  },
1177
1181
  "description": "Stacks are ready-made stacks the plugin publishes."
1182
+ },
1183
+ "kinds": {
1184
+ "type": "array",
1185
+ "items": {
1186
+ "$ref": "#/$defs/ProjectKind"
1187
+ },
1188
+ "description": "Kinds are the project kinds the plugin can scaffold with generate. Absent or empty means all three (app, lib and package): what every plugin that says nothing does. A plugin that scaffolds only some, such as an app, lists them, so the host offers and the conformance suite asks for just those."
1178
1189
  }
1179
1190
  },
1180
1191
  "required": [
@@ -1639,6 +1650,43 @@ _SCHEMA_JSON = r'''{
1639
1650
  "auth"
1640
1651
  ]
1641
1652
  },
1653
+ "ReleaseDefaults": {
1654
+ "description": "ReleaseDefaults are release settings a plugin supplies for a project: the same fields as the release-from-a-command settings of smith.toml, used for the ones the project's table leaves out.",
1655
+ "type": "object",
1656
+ "properties": {
1657
+ "build": {
1658
+ "type": "string",
1659
+ "description": "Build is the shell command that makes the files, run at the workspace root on a runner of each platform."
1660
+ },
1661
+ "assets": {
1662
+ "type": "array",
1663
+ "items": {
1664
+ "type": "string"
1665
+ },
1666
+ "description": "Assets are workspace-relative globs of the files Build leaves."
1667
+ },
1668
+ "platforms": {
1669
+ "type": "array",
1670
+ "items": {
1671
+ "type": "string"
1672
+ },
1673
+ "description": "Platforms are the runner platforms (windows-x64, macos-arm64, macos-x64, linux-x64, linux-arm64)."
1674
+ },
1675
+ "assetName": {
1676
+ "type": "string",
1677
+ "description": "AssetName renames each file on upload; see the asset_name setting."
1678
+ },
1679
+ "checksums": {
1680
+ "type": "boolean",
1681
+ "description": "Checksums attaches a checksums file for the files a runner uploads."
1682
+ }
1683
+ },
1684
+ "required": [
1685
+ "build",
1686
+ "assets",
1687
+ "platforms"
1688
+ ]
1689
+ },
1642
1690
  "RemoveParams": {
1643
1691
  "description": "RemoveParams tells a plugin a project is being removed. The host deletes the project's directory first; the plugin cleans what it owns outside it (a go.work entry, a lockfile, an installed package).",
1644
1692
  "type": "object",
@@ -73,6 +73,7 @@ __all__ = [
73
73
  "PublishedResult",
74
74
  "Registries",
75
75
  "Registry",
76
+ "ReleaseDefaults",
76
77
  "RemoveParams",
77
78
  "RemoveResult",
78
79
  "Request",
@@ -413,6 +414,12 @@ class Contribution(TypedDict, total=False):
413
414
  DependsOn adds dependencies to tasks the project already has, by task name ({"lint":
414
415
  ["slice-check"]}).
415
416
  """
417
+ release: ReleaseDefaults
418
+ """
419
+ Release is how the project's release files are made, for a project that releases through
420
+ GitHub releases and leaves them out of its smith.toml [projects.<name>.release] table; what
421
+ the table sets wins.
422
+ """
416
423
 
417
424
 
418
425
  class _CredentialRequired(TypedDict):
@@ -758,6 +765,13 @@ class InitializeResult(_InitializeResultRequired, total=False):
758
765
  """Conflicts are plugins that must not be in the same project."""
759
766
  stacks: list[Stack]
760
767
  """Stacks are ready-made stacks the plugin publishes."""
768
+ kinds: list[ProjectKind]
769
+ """
770
+ Kinds are the project kinds the plugin can scaffold with generate. Absent or empty means all
771
+ three (app, lib and package): what every plugin that says nothing does. A plugin that
772
+ scaffolds only some, such as an app, lists them, so the host offers and the conformance suite
773
+ asks for just those.
774
+ """
761
775
 
762
776
 
763
777
  class Input(TypedDict):
@@ -1117,6 +1131,34 @@ class Registry(_RegistryRequired, total=False):
1117
1131
  """
1118
1132
 
1119
1133
 
1134
+ class _ReleaseDefaultsRequired(TypedDict):
1135
+ build: str
1136
+ """
1137
+ Build is the shell command that makes the files, run at the workspace root on a runner of
1138
+ each platform.
1139
+ """
1140
+ assets: list[str]
1141
+ """Assets are workspace-relative globs of the files Build leaves."""
1142
+ platforms: list[str]
1143
+ """
1144
+ Platforms are the runner platforms (windows-x64, macos-arm64, macos-x64, linux-x64,
1145
+ linux-arm64).
1146
+ """
1147
+
1148
+
1149
+ class ReleaseDefaults(_ReleaseDefaultsRequired, total=False):
1150
+ """
1151
+ ReleaseDefaults are release settings a plugin supplies for a project: the same fields as the
1152
+ release-from-a-command settings of smith.toml, used for the ones the project's table leaves
1153
+ out.
1154
+ """
1155
+
1156
+ assetName: str
1157
+ """AssetName renames each file on upload; see the asset_name setting."""
1158
+ checksums: bool
1159
+ """Checksums attaches a checksums file for the files a runner uploads."""
1160
+
1161
+
1120
1162
  class _RemoveParamsRequired(TypedDict):
1121
1163
  project: Project
1122
1164
 
@@ -1420,3 +1462,10 @@ class PluginDescription(_PluginDescriptionRequired, total=False):
1420
1462
  """Conflicts are plugins that must not be in the same project."""
1421
1463
  stacks: list[Stack]
1422
1464
  """Stacks are ready-made stacks the plugin publishes."""
1465
+ kinds: list[ProjectKind]
1466
+ """
1467
+ Kinds are the project kinds the plugin can scaffold with generate. Absent or empty means all
1468
+ three (app, lib and package): what every plugin that says nothing does. A plugin that
1469
+ scaffolds only some, such as an app, lists them, so the host offers and the conformance suite
1470
+ asks for just those.
1471
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: monosmith-plugin-sdk
3
- Version: 0.2.0
3
+ Version: 0.4.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
@@ -29,6 +29,7 @@ src/monosmith_plugin_sdk/concurrency/__init__.py
29
29
  src/monosmith_plugin_sdk/concurrency/concurrency_policy.py
30
30
  src/monosmith_plugin_sdk/conformance/__init__.py
31
31
  src/monosmith_plugin_sdk/conformance/check_generation_use_case.py
32
+ src/monosmith_plugin_sdk/conformance/check_kind_change_use_case.py
32
33
  src/monosmith_plugin_sdk/conformance/check_plugin_use_case.py
33
34
  src/monosmith_plugin_sdk/conformance/check_scheduling_use_case.py
34
35
  src/monosmith_plugin_sdk/conformance/conformance_report_model.py