monosmith-plugin-sdk 0.4.0__tar.gz → 0.5.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.4.0/src/monosmith_plugin_sdk.egg-info → monosmith_plugin_sdk-0.5.0}/PKG-INFO +1 -1
  2. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/pyproject.toml +1 -1
  3. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/__init__.py +2 -0
  4. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/protocol/protocol_schema_contract.py +71 -0
  5. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/protocol/protocol_types_contract.py +52 -2
  6. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/__init__.py +2 -0
  7. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/plugin_contract.py +8 -0
  8. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/plugin_members_config.py +1 -0
  9. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0/src/monosmith_plugin_sdk.egg-info}/PKG-INFO +1 -1
  10. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/LICENSE +0 -0
  11. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/README.md +0 -0
  12. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/setup.cfg +0 -0
  13. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/build_dir/__init__.py +0 -0
  14. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/build_dir/build_dir_algorithm.py +0 -0
  15. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/cancellation/__init__.py +0 -0
  16. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/cancellation/cancel_token_model.py +0 -0
  17. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/cancellation/request_cancelled_error.py +0 -0
  18. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/ci/__init__.py +0 -0
  19. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/ci/ci_contribution_algorithm.py +0 -0
  20. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/codec/__init__.py +0 -0
  21. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/codec/encode_by_schema_algorithm.py +0 -0
  22. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/codec/encode_error.py +0 -0
  23. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/codec/encode_json_value_algorithm.py +0 -0
  24. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/codec/message_parse_error.py +0 -0
  25. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/codec/method_codec_algorithm.py +0 -0
  26. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/codec/normalize_by_schema_algorithm.py +0 -0
  27. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/codec/params_error.py +0 -0
  28. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/codec/received_message_contract.py +0 -0
  29. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/codec/schema_lookup_algorithm.py +0 -0
  30. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/codec/wire_message_mapper.py +0 -0
  31. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/concurrency/__init__.py +0 -0
  32. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/concurrency/concurrency_policy.py +0 -0
  33. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/conformance/__init__.py +0 -0
  34. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/conformance/check_generation_use_case.py +0 -0
  35. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/conformance/check_kind_change_use_case.py +0 -0
  36. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/conformance/check_plugin_use_case.py +0 -0
  37. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/conformance/check_scheduling_use_case.py +0 -0
  38. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/conformance/conformance_report_model.py +0 -0
  39. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/conformance/find_manifests_algorithm.py +0 -0
  40. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/conformance/go_list_mapper.py +0 -0
  41. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/framing/__init__.py +0 -0
  42. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/framing/frame_message_algorithm.py +0 -0
  43. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/framing/frame_reader_store.py +0 -0
  44. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/framing/framing_error.py +0 -0
  45. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/host/__init__.py +0 -0
  46. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/host/call_interrupted_error.py +0 -0
  47. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/host/connect_plugin_use_case.py +0 -0
  48. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/host/host_options_contract.py +0 -0
  49. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/host/plugin_client_client.py +0 -0
  50. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/host/start_plugin_use_case.py +0 -0
  51. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/jsondoc/__init__.py +0 -0
  52. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/jsondoc/indent_raw_json_algorithm.py +0 -0
  53. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/jsondoc/json_document_error.py +0 -0
  54. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/jsondoc/json_document_model.py +0 -0
  55. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/jsondoc/scan_json_object_algorithm.py +0 -0
  56. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/plugin_refs/__init__.py +0 -0
  57. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/plugin_refs/plugin_ref_policy.py +0 -0
  58. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/plugin_roles/__init__.py +0 -0
  59. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/plugin_roles/plugin_role_policy.py +0 -0
  60. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/projects/__init__.py +0 -0
  61. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/projects/audit_settings_policy.py +0 -0
  62. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/projects/manifest_match_algorithm.py +0 -0
  63. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/projects/project_kind_policy.py +0 -0
  64. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/projects/publishes_policy.py +0 -0
  65. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/projects/set_toolchain_algorithm.py +0 -0
  66. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/projects/stack_plugins_algorithm.py +0 -0
  67. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/protocol/__init__.py +0 -0
  68. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/protocol/rpc_error.py +0 -0
  69. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/py.typed +0 -0
  70. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/scaffold/__init__.py +0 -0
  71. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/scaffold/scaffold_data_mapper.py +0 -0
  72. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/scaffold/scaffold_project_use_case.py +0 -0
  73. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/capabilities_of_algorithm.py +0 -0
  74. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/claim_stdio_use_case.py +0 -0
  75. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/dispatch_request_use_case.py +0 -0
  76. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/frame_writer_store.py +0 -0
  77. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/initialize_plugin_use_case.py +0 -0
  78. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/protocol_streams_contract.py +0 -0
  79. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/request_outcome_contract.py +0 -0
  80. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/request_pool_store.py +0 -0
  81. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/serve/serve_use_case.py +0 -0
  82. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/tasks/__init__.py +0 -0
  83. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/tasks/contribute_tasks_algorithm.py +0 -0
  84. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/tasks/task_algorithm.py +0 -0
  85. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/templating/__init__.py +0 -0
  86. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/templating/file_exists_error.py +0 -0
  87. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/templating/parse_template_algorithm.py +0 -0
  88. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/templating/render_template_algorithm.py +0 -0
  89. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/templating/template_error.py +0 -0
  90. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/templating/template_functions_algorithm.py +0 -0
  91. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/templating/template_syntax_contract.py +0 -0
  92. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/templating/tokenize_action_algorithm.py +0 -0
  93. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk/templating/write_templates_use_case.py +0 -0
  94. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk.egg-info/SOURCES.txt +0 -0
  95. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.0}/src/monosmith_plugin_sdk.egg-info/dependency_links.txt +0 -0
  96. {monosmith_plugin_sdk-0.4.0 → monosmith_plugin_sdk-0.5.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.4.0
3
+ Version: 0.5.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.4.0"
7
+ version = "0.5.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"
@@ -91,6 +91,7 @@ from .protocol import * # noqa: F403
91
91
  from .scaffold import scaffold_data, scaffold_project
92
92
  from .serve import (
93
93
  CIContributor,
94
+ ComponentLister,
94
95
  Contributor,
95
96
  DeclarationEditor,
96
97
  DependencyManager,
@@ -127,6 +128,7 @@ __all__ = [
127
128
  "Remover",
128
129
  "KindChanger",
129
130
  "DependencyManager",
131
+ "ComponentLister",
130
132
  "DeclarationEditor",
131
133
  "LatestReader",
132
134
  "Contributor",
@@ -219,6 +219,17 @@ _SCHEMA_JSON = r'''{
219
219
  },
220
220
  "capability": "latest",
221
221
  "notification": false
222
+ },
223
+ "sbom/components": {
224
+ "description": "Asks which components a project ships (its locked dependencies, read from a lockfile where the ecosystem has one and from the manifest otherwise), as package URLs, for the SBOM a release attaches.",
225
+ "params": {
226
+ "$ref": "#/$defs/ComponentsParams"
227
+ },
228
+ "result": {
229
+ "$ref": "#/$defs/ComponentsResult"
230
+ },
231
+ "capability": "components",
232
+ "notification": false
222
233
  }
223
234
  },
224
235
  "x-errorCodes": [
@@ -543,6 +554,10 @@ _SCHEMA_JSON = r'''{
543
554
  "cancel": {
544
555
  "type": "boolean",
545
556
  "description": "Cancel says the plugin stops the work of a request when the host sends a cancel notification with its id, then answers that request with its result (if the work was already done) or the request-cancelled error. A host never sends the notification to a plugin without it."
557
+ },
558
+ "components": {
559
+ "type": "boolean",
560
+ "description": "Components lists a project's dependencies for its SBOM."
546
561
  }
547
562
  }
548
563
  },
@@ -600,6 +615,62 @@ _SCHEMA_JSON = r'''{
600
615
  }
601
616
  }
602
617
  },
618
+ "Component": {
619
+ "description": "Component is one dependency of a project.",
620
+ "type": "object",
621
+ "properties": {
622
+ "name": {
623
+ "type": "string"
624
+ },
625
+ "version": {
626
+ "type": "string",
627
+ "description": "Version is the locked version, or the declared range when the project has no lockfile."
628
+ },
629
+ "purl": {
630
+ "type": "string",
631
+ "description": "PURL is the package URL (https://github.com/package-url/purl-spec)."
632
+ }
633
+ },
634
+ "required": [
635
+ "name",
636
+ "purl"
637
+ ]
638
+ },
639
+ "ComponentsParams": {
640
+ "description": "ComponentsParams asks a plugin for the components one of its projects ships: what a CycloneDX SBOM lists.",
641
+ "type": "object",
642
+ "properties": {
643
+ "project": {
644
+ "$ref": "#/$defs/Project"
645
+ }
646
+ },
647
+ "required": [
648
+ "project"
649
+ ]
650
+ },
651
+ "ComponentsResult": {
652
+ "description": "ComponentsResult lists the components, read from a lockfile where the ecosystem has one and from the manifest otherwise. An empty list is an answer: the project declares no dependencies.",
653
+ "type": "object",
654
+ "properties": {
655
+ "components": {
656
+ "type": "array",
657
+ "items": {
658
+ "$ref": "#/$defs/Component"
659
+ }
660
+ },
661
+ "source": {
662
+ "type": "string",
663
+ "description": "Source is the workspace-relative file the list was read from, \"\" when the project has none."
664
+ },
665
+ "purl": {
666
+ "type": "string",
667
+ "description": "PURL is the project's own package URL when it has a registry identity (without a version: the release supplies it); \"\" otherwise."
668
+ }
669
+ },
670
+ "required": [
671
+ "components"
672
+ ]
673
+ },
603
674
  "ContributeParams": {
604
675
  "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.",
605
676
  "type": "object",
@@ -32,6 +32,9 @@ __all__ = [
32
32
  "Capabilities",
33
33
  "ChangeKindParams",
34
34
  "ChangeKindResult",
35
+ "Component",
36
+ "ComponentsParams",
37
+ "ComponentsResult",
35
38
  "ContributeParams",
36
39
  "ContributeResult",
37
40
  "Contribution",
@@ -152,11 +155,11 @@ class ErrorCodes:
152
155
  ERROR_CODES = ErrorCodes()
153
156
 
154
157
 
155
- 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"]
158
+ 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", "sbom/components"]
156
159
  """Every method of the protocol, `initialize`, `shutdown` and the `cancel` notification too."""
157
160
 
158
161
 
159
- CapabilityName = Literal["discover", "generate", "version", "publish", "ci", "doctor", "contribute", "remove", "changeKind", "published", "dependencies", "declarations", "latest", "cancel"]
162
+ CapabilityName = Literal["discover", "generate", "version", "publish", "ci", "doctor", "contribute", "remove", "changeKind", "published", "dependencies", "declarations", "latest", "cancel", "components"]
160
163
  """The names of the capability flags: the optional methods a plugin implements."""
161
164
 
162
165
 
@@ -179,6 +182,7 @@ METHOD_CAPABILITIES: Final[dict[str, str | None]] = {
179
182
  "dependencies/declared": "declarations",
180
183
  "dependencies/rewrite": "declarations",
181
184
  "dependencies/latest": "latest",
185
+ "sbom/components": "components",
182
186
  }
183
187
  """The capability a plugin advertises to be asked each method (`None`: always available).
184
188
 
@@ -332,6 +336,8 @@ class Capabilities(TypedDict, total=False):
332
336
  with its id, then answers that request with its result (if the work was already done) or the
333
337
  request-cancelled error. A host never sends the notification to a plugin without it.
334
338
  """
339
+ components: bool
340
+ """Components lists a project's dependencies for its SBOM."""
335
341
 
336
342
 
337
343
  class _ChangeKindParamsRequired(TypedDict):
@@ -383,6 +389,50 @@ class ChangeKindResult(TypedDict, total=False):
383
389
  """
384
390
 
385
391
 
392
+ class _ComponentRequired(TypedDict):
393
+ name: str
394
+ purl: str
395
+ """PURL is the package URL (https://github.com/package-url/purl-spec)."""
396
+
397
+
398
+ class Component(_ComponentRequired, total=False):
399
+ """Component is one dependency of a project."""
400
+
401
+ version: str
402
+ """Version is the locked version, or the declared range when the project has no lockfile."""
403
+
404
+
405
+ class ComponentsParams(TypedDict):
406
+ """
407
+ ComponentsParams asks a plugin for the components one of its projects ships: what a CycloneDX
408
+ SBOM lists.
409
+ """
410
+
411
+ project: Project
412
+
413
+
414
+ class _ComponentsResultRequired(TypedDict):
415
+ components: list[Component]
416
+
417
+
418
+ class ComponentsResult(_ComponentsResultRequired, total=False):
419
+ """
420
+ ComponentsResult lists the components, read from a lockfile where the ecosystem has one and
421
+ from the manifest otherwise. An empty list is an answer: the project declares no
422
+ dependencies.
423
+ """
424
+
425
+ source: str
426
+ """
427
+ Source is the workspace-relative file the list was read from, "" when the project has none.
428
+ """
429
+ purl: str
430
+ """
431
+ PURL is the project's own package URL when it has a registry identity (without a version: the
432
+ release supplies it); "" otherwise.
433
+ """
434
+
435
+
386
436
  class ContributeParams(TypedDict):
387
437
  """
388
438
  ContributeParams hands a plugin the projects it applies to: those whose stack includes it,
@@ -3,6 +3,7 @@
3
3
  from .capabilities_of_algorithm import capabilities_of, implements_method
4
4
  from .plugin_contract import (
5
5
  CIContributor,
6
+ ComponentLister,
6
7
  Contributor,
7
8
  DeclarationEditor,
8
9
  DependencyManager,
@@ -27,6 +28,7 @@ __all__ = [
27
28
  "ByteSource",
28
29
  "CIContributor",
29
30
  "Contributor",
31
+ "ComponentLister",
30
32
  "DeclarationEditor",
31
33
  "DependencyManager",
32
34
  "Discoverer",
@@ -21,6 +21,8 @@ from ..protocol import (
21
21
  ChangeKindResult,
22
22
  CIParams,
23
23
  CIResult,
24
+ ComponentsParams,
25
+ ComponentsResult,
24
26
  ContributeParams,
25
27
  ContributeResult,
26
28
  DeclaredParams,
@@ -115,6 +117,12 @@ class KindChanger(Protocol):
115
117
  def change_kind(self, params: ChangeKindParams, cancel: CancelToken) -> ChangeKindResult: ...
116
118
 
117
119
 
120
+ class ComponentLister(Protocol):
121
+ """`sbom/components`: the components a project ships, for the SBOM a release attaches."""
122
+
123
+ def components(self, params: ComponentsParams, cancel: CancelToken) -> ComponentsResult: ...
124
+
125
+
118
126
  class DependencyManager(Protocol):
119
127
  """`dependencies/install` and `dependencies/uninstall`: both, or the capability is not advertised."""
120
128
 
@@ -23,6 +23,7 @@ PLUGIN_MEMBERS: dict[str, PluginMember] = {
23
23
  "contribute": PluginMember("contribute", ("contribute",)),
24
24
  "remove": PluginMember("remove", ("remove",)),
25
25
  "project/kind": PluginMember("change_kind", ("change_kind",)),
26
+ "sbom/components": PluginMember("components", ("components",)),
26
27
  "published": PluginMember("published", ("published",)),
27
28
  "dependencies/install": PluginMember("install", ("install", "uninstall")),
28
29
  "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.4.0
3
+ Version: 0.5.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