nutria-plugin 0.5.0__tar.gz → 0.6.1__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.
Files changed (54) hide show
  1. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/CHANGELOG.md +35 -0
  2. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/PKG-INFO +8 -5
  3. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/README.md +6 -4
  4. nutria_plugin-0.6.1/docs/capability-authoring.md +154 -0
  5. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/docs/connection-types.md +13 -11
  6. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/docs/index.md +5 -3
  7. nutria_plugin-0.6.1/docs/manifest.md +167 -0
  8. nutria_plugin-0.6.1/docs/migration-6.0.md +32 -0
  9. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/docs/python-api.md +2 -2
  10. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/docs/quickstart.md +6 -4
  11. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/docs/reviewable-actions.md +1 -1
  12. nutria_plugin-0.6.1/docs/skill-format.md +203 -0
  13. nutria_plugin-0.6.1/examples/my-first-plugin/plugin.json +65 -0
  14. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/pyproject.toml +2 -1
  15. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/src/nutria_plugin/__init__.py +40 -1
  16. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/src/nutria_plugin/bundle.py +14 -0
  17. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/src/nutria_plugin/capabilities.py +113 -21
  18. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/src/nutria_plugin/cli.py +18 -0
  19. nutria_plugin-0.6.1/src/nutria_plugin/hierarchy.py +135 -0
  20. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/src/nutria_plugin/manifest.py +1 -1
  21. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/src/nutria_plugin/mcp_results.py +49 -0
  22. nutria_plugin-0.6.1/src/nutria_plugin/migrate.py +72 -0
  23. nutria_plugin-0.6.1/src/nutria_plugin/operation_facts.py +74 -0
  24. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/src/nutria_plugin/packaging.py +3 -1
  25. nutria_plugin-0.6.1/src/nutria_plugin/prepared_preview.py +163 -0
  26. nutria_plugin-0.6.1/src/nutria_plugin/skills.py +44 -0
  27. nutria_plugin-0.6.1/tests/__init__.py +0 -0
  28. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/tests/test_bundle.py +3 -2
  29. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/tests/test_capability_contracts.py +16 -14
  30. nutria_plugin-0.6.1/tests/test_contract_vnext.py +286 -0
  31. nutria_plugin-0.6.1/tests/test_hierarchy.py +185 -0
  32. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/tests/test_manifest.py +9 -7
  33. nutria_plugin-0.6.1/tests/test_prepared_preview.py +86 -0
  34. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/tests/test_reviewable_actions.py +25 -12
  35. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/tests/test_signing.py +1 -1
  36. nutria_plugin-0.6.1/tests/test_skill_format_docs.py +17 -0
  37. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/uv.lock +58 -1
  38. nutria_plugin-0.5.0/docs/manifest.md +0 -86
  39. nutria_plugin-0.5.0/docs/skill-format.md +0 -201
  40. nutria_plugin-0.5.0/examples/my-first-plugin/plugin.json +0 -14
  41. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/.github/workflows/publish.yml +0 -0
  42. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/.gitignore +0 -0
  43. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/docs/admin-extensions.md +0 -0
  44. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/docs/admin-flows.md +0 -0
  45. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/docs/cli.md +0 -0
  46. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/docs/security.md +0 -0
  47. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/examples/my-first-plugin/README.md +0 -0
  48. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/examples/my-first-plugin/hooks/hooks.json +0 -0
  49. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/examples/my-first-plugin/settings.schema.json +0 -0
  50. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/src/nutria_plugin/domains.py +0 -0
  51. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/src/nutria_plugin/signing.py +0 -0
  52. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/tests/test_cli.py +0 -0
  53. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/tests/test_mcp_results.py +0 -0
  54. {nutria_plugin-0.5.0 → nutria_plugin-0.6.1}/tests/test_packaging.py +0 -0
@@ -1,5 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.1
4
+
5
+ Additive; manifests that do not use the new field are unchanged.
6
+
7
+ - Add optional `provider_default_arguments` on capabilities with a `prepared_action`: optional declared
8
+ inputs that the provider fills with its own default. Validated by `nutria-plugin validate`.
9
+ - Add `check_prepared_preview` and `PREVIEW_CONFORMANCE_VECTORS`: one definition of the exact-preview
10
+ rule (snapshot arguments are declared tool arguments, required ones present, supplied ones echoed)
11
+ for plugin tests and hosts.
12
+ - Document the preview rule and the `x-nutria-host-control` schema key.
13
+
14
+ ## 0.6.0
15
+
16
+ Breaking: manifest schema 6.0 (5.0 is rejected). See `docs/migration-6.0.md`.
17
+
18
+ - Add required `effect_scope` (`agent_local`, `internal_state`, `lifecycle`, `world`),
19
+ orthogonal to `effect`.
20
+ - Make completion explicit: every non-read capability declares `evidence: none` or
21
+ `evidence: declared` with `receipts`, `basis` and `targets`. Hosts no longer synthesize
22
+ write receipts. Reads cannot declare completion.
23
+ - Replace input `sensitivity` with `data_class` (six classes) on inputs and outputs.
24
+ - Add `OperationFacts` and `validate_operation_facts`: handlers report facts; the host
25
+ classifies. Proves a declared completion is producible.
26
+ - Reject skill frontmatter `triggers` (new `SkillFrontmatter`), in bundles too.
27
+ - Add `nutria-plugin migrate` (5.0 to 6.0 with review report).
28
+ - New validators: external writes live in the `world` scope, model-exposed world writes
29
+ need declared evidence and idempotency, agent-local capabilities cannot declare evidence.
30
+ - Add provider-neutral hierarchical attribute operations (`nutria_plugin.hierarchy`):
31
+ `OperationScope` (`self`, `selected_children`, `all_children`), `AttributeOperation` (with
32
+ current-operation `overrides`), `apply_attribute_operation` (reference semantics: a global assignment
33
+ replaces earlier child values; exceptions are not durable), `EffectiveAttributeState` (canonical
34
+ readback with factual `provider_representation`) and the optional capability field
35
+ `hierarchical_attributes`. `TargetFact` gains optional `effective_values` and
36
+ `provider_representation`. Additive: no existing 6.0 manifest changes meaning.
37
+
3
38
  ## 0.5.0
4
39
 
5
40
  - Replace manifest schema 4.0 with schema 5.0.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: nutria-plugin
3
- Version: 0.5.0
3
+ Version: 0.6.1
4
4
  Summary: SDK for building, validating, signing, and packaging Nutria plugins
5
5
  Project-URL: Homepage, https://github.com/AlRos14/nutria-plugin-sdk
6
6
  Project-URL: Repository, https://github.com/AlRos14/nutria-plugin-sdk
@@ -11,6 +11,7 @@ Requires-Python: >=3.11
11
11
  Requires-Dist: cryptography>=41.0
12
12
  Requires-Dist: lxml>=4.9
13
13
  Requires-Dist: pydantic>=2.0
14
+ Requires-Dist: pyyaml>=6.0
14
15
  Provides-Extra: dev
15
16
  Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
16
17
  Requires-Dist: pytest>=8.0; extra == 'dev'
@@ -21,7 +22,7 @@ Description-Content-Type: text/markdown
21
22
 
22
23
  SDK for building, validating, signing, and packaging Nutria plugins.
23
24
 
24
- Release `0.5.0` accepts only manifest schema `5.0`. Capabilities use their real
25
+ Release `0.6.1` accepts only manifest schema `6.0`. Capabilities use their real
25
26
  business effect (`read`, `write`, or `external_write`); preparation is expressed
26
27
  by producing `prepared_action`, not by a workflow-phase effect. Every parsed
27
28
  requirement resolves `task_context` to `required`, `optional`, or `forbidden`,
@@ -34,7 +35,7 @@ and exact delivery of an approved snapshot.
34
35
  ## Install
35
36
 
36
37
  ```bash
37
- uv add nutria-plugin==0.5.0
38
+ uv add nutria-plugin==0.6.1
38
39
  ```
39
40
 
40
41
  ## Scaffold and validate
@@ -49,11 +50,11 @@ The generated directory contains `plugin.json`, component directories for
49
50
  connections, skills, context documents, specs and hooks, plus an optional
50
51
  settings schema and assets.
51
52
 
52
- ## Minimal schema 5.0 manifest
53
+ ## Minimal schema 6.0 manifest
53
54
 
54
55
  ```json
55
56
  {
56
- "schema_version": "5.0",
57
+ "schema_version": "6.0",
57
58
  "id": "my-workspace-plugin",
58
59
  "name": "My Workspace Plugin",
59
60
  "version": "0.1.0",
@@ -68,6 +69,7 @@ settings schema and assets.
68
69
  "description": "Read matching workspace resources.",
69
70
  "domains": ["products"],
70
71
  "effect": "read",
72
+ "effect_scope": "world",
71
73
  "tool": "search_workspace",
72
74
  "connection_id": "workspace",
73
75
  "requirements": {
@@ -80,6 +82,7 @@ settings schema and assets.
80
82
  "result_path": ".items",
81
83
  "resource_type": "workspace.item",
82
84
  "output_name": "items",
85
+ "data_class": "non_personal",
83
86
  "many": true
84
87
  }]
85
88
  }],
@@ -2,7 +2,7 @@
2
2
 
3
3
  SDK for building, validating, signing, and packaging Nutria plugins.
4
4
 
5
- Release `0.5.0` accepts only manifest schema `5.0`. Capabilities use their real
5
+ Release `0.6.1` accepts only manifest schema `6.0`. Capabilities use their real
6
6
  business effect (`read`, `write`, or `external_write`); preparation is expressed
7
7
  by producing `prepared_action`, not by a workflow-phase effect. Every parsed
8
8
  requirement resolves `task_context` to `required`, `optional`, or `forbidden`,
@@ -15,7 +15,7 @@ and exact delivery of an approved snapshot.
15
15
  ## Install
16
16
 
17
17
  ```bash
18
- uv add nutria-plugin==0.5.0
18
+ uv add nutria-plugin==0.6.1
19
19
  ```
20
20
 
21
21
  ## Scaffold and validate
@@ -30,11 +30,11 @@ The generated directory contains `plugin.json`, component directories for
30
30
  connections, skills, context documents, specs and hooks, plus an optional
31
31
  settings schema and assets.
32
32
 
33
- ## Minimal schema 5.0 manifest
33
+ ## Minimal schema 6.0 manifest
34
34
 
35
35
  ```json
36
36
  {
37
- "schema_version": "5.0",
37
+ "schema_version": "6.0",
38
38
  "id": "my-workspace-plugin",
39
39
  "name": "My Workspace Plugin",
40
40
  "version": "0.1.0",
@@ -49,6 +49,7 @@ settings schema and assets.
49
49
  "description": "Read matching workspace resources.",
50
50
  "domains": ["products"],
51
51
  "effect": "read",
52
+ "effect_scope": "world",
52
53
  "tool": "search_workspace",
53
54
  "connection_id": "workspace",
54
55
  "requirements": {
@@ -61,6 +62,7 @@ settings schema and assets.
61
62
  "result_path": ".items",
62
63
  "resource_type": "workspace.item",
63
64
  "output_name": "items",
65
+ "data_class": "non_personal",
64
66
  "many": true
65
67
  }]
66
68
  }],
@@ -0,0 +1,154 @@
1
+ # Capability author guide (schema 6.0)
2
+
3
+ This guide explains how to declare a capability so the Host can project, authorize, classify and disclose
4
+ it without any plugin-specific code. The authoritative field reference is [manifest.md](manifest.md);
5
+ migration from 5.0 is in [migration-6.0.md](migration-6.0.md).
6
+
7
+ ## 1. Effect and effect scope
8
+
9
+ `effect` says whether something changes; `effect_scope` says where.
10
+
11
+ | `effect` | Meaning |
12
+ | --- | --- |
13
+ | `read` | Observes. Never declares `completion` or a world `prepared_action`. |
14
+ | `write` | Changes state. |
15
+ | `external_write` | Changes something outside the system (a message, a shipment). Scope must be `world`. |
16
+
17
+ | `effect_scope` | Use for |
18
+ | --- | --- |
19
+ | `agent_local` | Navigation, notes and other Principal-only state. No completion evidence. |
20
+ | `internal_state` | Nutria's own records. |
21
+ | `lifecycle` | Tasks, Interactions, PreparedActions. |
22
+ | `world` | Business systems and people. |
23
+
24
+ ## 2. Completion
25
+
26
+ Every non-read capability declares `completion` explicitly:
27
+
28
+ ```json
29
+ "completion": {
30
+ "evidence": "declared",
31
+ "receipts": ["shipment.created"],
32
+ "basis": "provider_outcome",
33
+ "targets": "single"
34
+ }
35
+ ```
36
+
37
+ - `evidence: "none"` means the capability never proves completion; it must not list receipts, basis or targets.
38
+ - `basis` is how the provider proves it: `provider_outcome` (the provider's own success), `confirmed_mutation`,
39
+ `verified_readback` (read the target back), `delivery_confirmation`, or `prepared_action` (a preview).
40
+ - `targets: "all_requested"` means every requested target must succeed; one success out of ten is `partial`.
41
+ - Model-selectable world writes must declare evidence and execution idempotency.
42
+
43
+ ## 3. Operation facts (what handlers return)
44
+
45
+ Handlers report facts, never "completed". Return them in `structuredContent.operation_facts`:
46
+
47
+ ```json
48
+ {
49
+ "provider_outcome": "succeeded",
50
+ "mutation": "confirmed",
51
+ "verification": "verified",
52
+ "receipt_kinds": ["shipment.created"],
53
+ "targets": [{"target_ref": "SHP-1", "outcome": "succeeded"}],
54
+ "provider_receipt": {"shipment_id": "SHP-1"}
55
+ }
56
+ ```
57
+
58
+ The Host's ReceiptClassifier combines the declared contract and these facts into `completed`, `partial`,
59
+ `accepted`, `uncertain`, `failed`, `prepared`, `observed` or `not_applicable`. A write whose declared proof is
60
+ missing becomes `uncertain` and must be reconciled before any retry. `validate_operation_facts` rejects
61
+ contradictions (see the error table).
62
+
63
+ ## 4. Data classification
64
+
65
+ Every input and output declares `data_class`:
66
+
67
+ | `data_class` | Examples |
68
+ | --- | --- |
69
+ | `non_personal` | Catalogue data, public web content |
70
+ | `business_resource_identifier` | Product or order ids |
71
+ | `operational_identifier` | Task, card or prepared-action handles |
72
+ | `personal_identifier` | Phone, email, address, recipient |
73
+ | `personal_content` | Message bodies, notes, documents about people |
74
+ | `special_category` | Health and other special categories |
75
+
76
+ The Host decides what reaches the inference provider from these classes, the tenant policy and the provider's
77
+ retention posture. It never guesses from field names, so classify honestly: an output that may carry
78
+ personal text is `personal_content`.
79
+
80
+ ## 5. PreparedAction authoring
81
+
82
+ A model-selectable `external_write` must declare `prepared_action`. The model calls the preparation
83
+ capability, which must be pure and read-only and returns an exact preview. The Host freezes it and executes
84
+ the host-only execution capability only after authorization, with idempotency and the declared receipt.
85
+ Never re-resolve targets at execution time; execute exactly what the preview froze.
86
+
87
+ The preview `arguments` are the re-executable call of the tool, not the provider's wire parameters:
88
+
89
+ * every key is a declared argument of the tool (a Trello `list_id`, never the API's `idList`);
90
+ * every required argument is present;
91
+ * every argument the caller supplied is echoed with the same value, an empty string included. Provider
92
+ normalization may add subfields but never changes what was supplied.
93
+
94
+ A provider may fill an optional argument with its own default (for example today's date). Declare it in
95
+ `provider_default_arguments`: the host then accepts an unset or empty supplied value there and the filled
96
+ value in the preview. A non-empty supplied value stays strict, and the declaration must name an optional
97
+ declared input. Declare it in the manifest, which is signed, not in tool code.
98
+
99
+ `nutria_plugin.check_prepared_preview(capability, input_schema, requested, snapshot)` is the single
100
+ definition of this rule; call it in plugin tests with the schema your server exposes.
101
+ `PREVIEW_CONFORMANCE_VECTORS` are shared cases that plugin tests and hosts both run against their own
102
+ implementation.
103
+
104
+ Schema extension keys the host understands on a tool argument: `x-nutria-host-control` (the host
105
+ supplies the value, for example a state fingerprint). Anything else under `x-nutria-` is host-private.
106
+
107
+ ## 6. Hierarchical attribute operations
108
+
109
+ An entity can own child entities (variants of an item, ads of a campaign, establishments of an
110
+ organization, child resources of a configuration). The Agent decides **entity, children, attribute, value
111
+ and scope**; the provider materializes it. The contract is domain-neutral (`nutria_plugin.hierarchy`):
112
+
113
+ | Scope | Meaning |
114
+ | --- | --- |
115
+ | `self` | The value applies to the entity itself only. |
116
+ | `selected_children` | The value applies to exactly the listed children (`targets`). |
117
+ | `all_children` | The value applies to every relevant child. Any value a child held before, including a special one from an earlier operation, is replaced. |
118
+
119
+ * `overrides` are explicit exceptions of **this operation only** (`all_children` with other values for named
120
+ children, e.g. creation "all at V, but B at X"). They are never remembered: a later `all_children`
121
+ operation replaces them. Do not model durable inheritance.
122
+ * A capability declares what it supports per attribute with `hierarchical_attributes`
123
+ (`[{"attribute": "...", "scopes": ["all_children", ...]}]`). Different attributes may declare different
124
+ scopes. Only write capabilities may declare it; an attribute appears once.
125
+ * `apply_attribute_operation` is the reference semantics (the oracle for contract tests);
126
+ `EffectiveAttributeState` is the canonical readback.
127
+ * **Readback is the effective state**, not the provider's physical layout. If the provider stores a value on
128
+ the children and leaves the parent blank, report the effective values per child and put the physical
129
+ parent value in `provider_representation` (observability only). The Agent must never need to know how the
130
+ provider stores it.
131
+ * Facts stay facts: report per-child `TargetFact.effective_values` and, on the parent target,
132
+ `provider_representation`. Completion is still concluded by the Host from the declared contract, and the
133
+ Agent decides whether the Objective is complete.
134
+
135
+ ## 7. Validation errors
136
+
137
+ | Error | Fix |
138
+ | --- | --- |
139
+ | `non-read capabilities must declare completion explicitly` | Add `completion` (`declared` or `none`). |
140
+ | `read capabilities observe; they must not declare completion` | Remove `completion` from reads. |
141
+ | `external_write capabilities must have effect_scope 'world'` | Set `effect_scope: "world"`. |
142
+ | `agent_local capabilities cannot declare completion evidence` | Use `evidence: "none"` or another scope. |
143
+ | `model-selectable world writes require declared completion evidence` | Declare receipts and basis. |
144
+ | `model-selectable world writes require execution idempotency` | Add `idempotency.required_for_execution`. |
145
+ | `model-selectable external writes require prepared_action` | Add a `prepared_action` contract. |
146
+ | `declared completion evidence requires receipts` / `... a basis` | Fill both. |
147
+ | `completion evidence 'none' must not declare receipts or basis` | Remove them. |
148
+ | `completion receipts must be stable lowercase identifiers` | Use ids like `email.reply.sent`. |
149
+ | `model-selectable reads require declared outputs` | Declare `produces` with `data_class`. |
150
+ | `model-selectable writes require declared inputs` | Declare every business input with `data_class`. |
151
+ | `a confirmed mutation cannot come from a failed or inapplicable outcome` | Fix the reported facts. |
152
+ | `verified requires a mutation fact other than none` | Report the mutation you verified. |
153
+ | `partial operations must report at least two targets` | Report per-target outcomes. |
154
+ | `verified operations cannot report mismatched fields` | Report `verification: "mismatch"`. |
@@ -17,22 +17,24 @@ Examples:
17
17
  - `conn_mrw-shipping--sagec__TransmEnvio`
18
18
  - `conn_trello-workspace--trello__get_card`
19
19
 
20
- This name is used in `SKILL.md` `tools_required` and `authority_levels` fields,
21
- and in the Nutria approval log.
20
+ This name identifies the provider tool behind a capability. Skills normally
21
+ refer to canonical capability IDs in `capabilities_required`, not to generated
22
+ physical tool names or runtime approval records.
22
23
 
23
- Tools named by a `reviewable_actions` contract are host-executor internals.
24
- ChatBotNutralia removes those execution/preparation tools from model-facing
25
- schemas and invokes them only after the host action has been approved.
24
+ Tools named by a `reviewable_actions` contract belong to the manifest's
25
+ provider/Host graph. The skill may explain the business action, but does not
26
+ restate the preparation, execution, or approval lifecycle.
26
27
 
27
- ## Authority levels
28
+ ## Capability effects
28
29
 
29
- Every tool must declare an authority level that controls approval requirements.
30
+ Every capability declares its effect and structural requirements in
31
+ `plugin.json`. A skill does not grant authority or control approval.
30
32
 
31
- | Level | Description |
33
+ | Effect | Description |
32
34
  |-------|-------------|
33
- | `read` | Read-only query — no approval required |
34
- | `write_internal` | Writes to Nutria-internal state only — no external approval required |
35
- | `write_external` | Writes to an external system — requires human approval |
35
+ | `read` | Read-only query with no external business mutation |
36
+ | `write` | Local or internal mutation under Host authority |
37
+ | `external_write` | External business effect governed by the declared capability contract |
36
38
 
37
39
  ---
38
40
 
@@ -1,11 +1,13 @@
1
1
  # nutria-plugin SDK documentation
2
2
 
3
- Developer reference for SDK `0.5.0` and manifest schema `5.0`.
3
+ Developer reference for SDK `0.6.1` and manifest schema `6.0`.
4
4
 
5
5
  | Document | Purpose |
6
6
  |---|---|
7
- | [quickstart.md](quickstart.md) | Build a strict schema 5.0 plugin |
7
+ | [quickstart.md](quickstart.md) | Build a strict schema 6.0 plugin |
8
+ | [migration-6.0.md](migration-6.0.md) | Migrate a 5.0 plugin to 6.0 |
8
9
  | [manifest.md](manifest.md) | Manifest, capability, and provider contracts |
10
+ | [capability-authoring.md](capability-authoring.md) | Effect scope, completion, operation facts, data classes, PreparedActions, validation errors |
9
11
  | [reviewable-actions.md](reviewable-actions.md) | Host-owned drafts and external delivery |
10
12
  | [python-api.md](python-api.md) | Public Python API |
11
13
  | [connection-types.md](connection-types.md) | Supported runtime/connection types |
@@ -16,6 +18,6 @@ Developer reference for SDK `0.5.0` and manifest schema `5.0`.
16
18
  | [cli.md](cli.md) | CLI commands |
17
19
 
18
20
  A plugin bundle can contain connections, skills, context documents, hooks,
19
- settings, specs, and declarative admin assets. Its schema 5.0 manifest must also
21
+ settings, specs, and declarative admin assets. Its schema 6.0 manifest must also
20
22
  declare at least one typed capability and world provider. Older schemas are not
21
23
  loaded or migrated.
@@ -0,0 +1,167 @@
1
+ # plugin.json manifest reference
2
+
3
+ `plugin.json` is the single source of truth for plugin identity, runtime,
4
+ capability authority, prepared-action provider defaults, and provider topology. SDK 0.6.1 accepts exactly schema
5
+ `6.0`; older schemas and unknown fields fail validation.
6
+
7
+ ## Required top-level fields
8
+
9
+ | Field | Contract |
10
+ |---|---|
11
+ | `schema_version` | Literal `"6.0"` |
12
+ | `id` | Lowercase plugin slug |
13
+ | `name`, `description`, `author` | Non-empty display metadata |
14
+ | `version` | Semantic version |
15
+ | `runtime_types` | One or more supported runtime types |
16
+ | `capabilities` | At least one typed capability |
17
+ | `world_providers` | At least one typed provider |
18
+
19
+ Optional fields include `default_scope`, `paths`, `required_secrets`,
20
+ `optional_secrets`, `remote_endpoints`, `tags`, `reviewable_actions`,
21
+ `admin_extensions`, `admin_flows`, `mcp_server_entry`, `homepage`, `license`,
22
+ and `signature`. A `compatibility` field is not part of schema 6.0.
23
+
24
+ ## Capability descriptor
25
+
26
+ Each capability declares:
27
+
28
+ - stable `id`, `title`, and `description`;
29
+ - `effect`: `read`, `write`, or `external_write` (the authority/mutation dimension);
30
+ - `effect_scope`: `agent_local`, `internal_state`, `lifecycle`, or `world` (where the effect lands);
31
+ - concrete `tool` and optional `connection_id`;
32
+ - typed `inputs`, `consumes`, and `produces` bindings, each carrying a `data_class`;
33
+ - required `requirements.authority` and `requirements.audience`, plus resolved
34
+ `requirements.task_context` (`required`, `optional`, or `forbidden`, default
35
+ `optional`);
36
+ - required `exposure`: `model`, `host`, or `admin`;
37
+ - for every non-read capability, an explicit `completion` contract.
38
+
39
+ `host` and `admin` exposure require `non_callable_reason` with a stable code and
40
+ safe summary. `model` exposure must not declare it. Hosts structurally promote
41
+ task-owned resource bindings to effective `task_context: "required"`.
42
+
43
+ ### Effect and effect scope
44
+
45
+ `effect` says how much authority a call needs. `effect_scope` is orthogonal and says
46
+ where the effect lands:
47
+
48
+ | `effect_scope` | Examples |
49
+ |---|---|
50
+ | `agent_local` | terminal, scratch files |
51
+ | `internal_state` | notebook, memory, preferences |
52
+ | `lifecycle` | Interactions, Tasks, PreparedAction storage |
53
+ | `world` | WooCommerce, MRW, Trello, email, WhatsApp |
54
+
55
+ `effect_scope: world` does **not** mean only world effects can complete an Objective.
56
+ "Remember this" legitimately completes through `internal_state`. A completion
57
+ expectation never exists merely because `effect != read`: it exists only when the
58
+ capability declares completion evidence.
59
+
60
+ ### Completion contract
61
+
62
+ Every non-read capability declares exactly one of:
63
+
64
+ ```json
65
+ "completion": {"evidence": "none"}
66
+ ```
67
+
68
+ or
69
+
70
+ ```json
71
+ "completion": {
72
+ "evidence": "declared",
73
+ "receipts": ["email.sent"],
74
+ "basis": "delivery_confirmation",
75
+ "targets": "single"
76
+ }
77
+ ```
78
+
79
+ `basis` is one of `provider_outcome`, `confirmed_mutation`, `verified_readback`,
80
+ `delivery_confirmation` (two-phase: acceptance is not delivery), or `prepared_action`.
81
+ `targets: all_requested` means a multi-target effect is complete only when every
82
+ requested target is confirmed; a partial result stays `partial`. Read capabilities must
83
+ not declare completion. Hosts never synthesize receipts for writes.
84
+
85
+ Handlers report facts under `operation_facts` (see `OperationFacts`); they do not conclude
86
+ `completed`. `validate_capability_result` checks that reported facts can satisfy the
87
+ declared contract (declared receipts present on a confirmed mutation, basis respected,
88
+ no receipts when evidence is `none`).
89
+
90
+ ### Data classification
91
+
92
+ Every input and output binding declares `data_class`:
93
+
94
+ | `data_class` | Meaning |
95
+ |---|---|
96
+ | `non_personal` | public or non-personal content |
97
+ | `business_resource_identifier` | product, order, SKU, EAN style identifiers |
98
+ | `operational_identifier` | internal operational refs (tracking, ids with no person) |
99
+ | `personal_identifier` | name, phone, email, address of a person |
100
+ | `personal_content` | free text that may contain personal data |
101
+ | `special_category` | health, biometric, and other special categories |
102
+
103
+ The contract declares the class; hosts must not infer it from field names. `semantic_field`
104
+ continues to carry semantic identity. `requires_provenance` stays independent.
105
+
106
+ ### Validation rules enforced by the SDK
107
+
108
+ | Rule | Error contains |
109
+ |---|---|
110
+ | non-read capability without `completion` | `must declare completion explicitly` |
111
+ | read capability with `completion` | `must not declare completion` |
112
+ | `external_write` outside `effect_scope: world` | `effect_scope 'world'` |
113
+ | `agent_local` with declared completion evidence | `agent_local` |
114
+ | model-exposed `external_write` without `prepared_action` | `require prepared_action` |
115
+ | model-exposed world write without declared evidence | `declared completion evidence` |
116
+ | model-exposed world write without required idempotency | `execution idempotency` |
117
+ | `declared` evidence without receipts or basis | `requires receipts` / `requires a basis` |
118
+ | input/output without `data_class`, or legacy `sensitivity` | `data_class` / `sensitivity` |
119
+ | skill frontmatter with `triggers` (or any unknown key) | `triggers` |
120
+ | reviewable action referencing unknown or mis-typed capabilities | existing reviewable errors |
121
+
122
+ Model-exposed `external_write` capabilities also declare `prepared_action`,
123
+ `idempotency` and `completion`. Reviewable delivery capabilities are instead
124
+ host-only and are linked through `reviewable_action_id`.
125
+
126
+ ## World provider descriptor
127
+
128
+ Every provider declares a stable ID, title, description, optional connection
129
+ and health capability, and one or more resource types. Each resource type has:
130
+
131
+ - a stable built-in or plugin-namespaced `id`;
132
+ - one or more `identity_fields`;
133
+ - optional search/inspect capability references;
134
+ - optional version field, TTL, and named safe/authorized projections.
135
+
136
+ Capability connections must have a matching provider connection. Referenced
137
+ search, inspect, health, prepare, and execute capabilities must exist in the
138
+ same manifest.
139
+
140
+ ## Reviewable actions
141
+
142
+ The host owns the encrypted draft and approval lifecycle. A reviewable action
143
+ maps stable semantic fields to one host-only external-write capability. Every
144
+ delivery maps `recipient`, `body`, and `idempotency_key`; required capability
145
+ inputs must be mapped. Preparation capabilities produce `prepared_action` and
146
+ declare their actual `read` or `write` mutation scope. See
147
+ [reviewable-actions.md](reviewable-actions.md).
148
+
149
+ ## Paths and settings
150
+
151
+ All component paths are relative and cannot contain empty, `.` or `..`
152
+ segments. `settings.schema.json` may use the host extensions
153
+ `x-nutria-store-scoped` and `x-nutria-store-default-key` for values that truly
154
+ vary by store.
155
+
156
+ ## Secrets and endpoints
157
+
158
+ Secret arrays contain names only. Remote endpoints must be absolute HTTP(S)
159
+ URLs and cannot target localhost, loopback, link-local, private, or reserved IP
160
+ ranges.
161
+
162
+ ## Validation
163
+
164
+ ```bash
165
+ uv run nutria-plugin validate .
166
+ uv run nutria-plugin pack . --output dist/plugin.zip
167
+ ```
@@ -0,0 +1,32 @@
1
+ # Migrating a plugin from schema 5.0 to 6.0
2
+
3
+ Schema 6.0 is a breaking release (SDK 0.6.0). 5.0 manifests fail validation.
4
+
5
+ ## What changed
6
+
7
+ | 5.0 | 6.0 |
8
+ |---|---|
9
+ | `completion: {"receipts": [...]}` optional, synthesized for writes by the host | `completion` required on every non-read capability: `{"evidence": "none"}` or `{"evidence": "declared", receipts, basis, targets}` |
10
+ | no effect scope | `effect_scope` required: `agent_local`, `internal_state`, `lifecycle`, `world` |
11
+ | input `sensitivity: safe | personal` | input and output `data_class` (six classes) |
12
+ | skill `triggers` tolerated by docs | rejected |
13
+ | handler results ad hoc | `operation_facts` (`OperationFacts`) |
14
+
15
+ ## Steps
16
+
17
+ 1. `uv add nutria-plugin==0.6.0`
18
+ 2. `uv run nutria-plugin migrate plugin.json` applies the mechanical changes, removes the
19
+ `signature`, and prints `REVIEW:` lines for every judgement call.
20
+ 3. Review each item. The tool picks conservative values:
21
+ - `effect_scope`: external writes become `world`; other writes are guessed from
22
+ `connection_id` and must be confirmed.
23
+ - `completion.basis` defaults to `provider_outcome`: choose `confirmed_mutation`,
24
+ `verified_readback`, `delivery_confirmation` (two-phase delivery) or `prepared_action`.
25
+ - `personal` inputs become `personal_identifier`; use `personal_content` for free text
26
+ and `special_category` where it applies. Identifiers that are not personal
27
+ (SKU, EAN, product id, tracking number) are `business_resource_identifier` or
28
+ `operational_identifier`.
29
+ 4. Remove `triggers` from every `SKILL.md`.
30
+ 5. Make handlers report `operation_facts` and cover them with
31
+ `validate_capability_result` in the plugin test-suite.
32
+ 6. `uv run nutria-plugin validate .`, then re-sign.
@@ -1,6 +1,6 @@
1
1
  # Python API reference
2
2
 
3
- SDK 0.5.0 exposes the strict schema 5.0 API.
3
+ SDK 0.6.1 exposes the strict schema 6.0 API.
4
4
 
5
5
  ```python
6
6
  from nutria_plugin import (
@@ -39,7 +39,7 @@ manifest.to_file(Path("plugin.json"))
39
39
  payload = manifest.model_dump(mode="json", exclude_none=True)
40
40
  ```
41
41
 
42
- Validation is strict: schema version must be `5.0`, top-level extras are
42
+ Validation is strict: schema version must be `6.0`, top-level extras are
43
43
  rejected, and capability/provider/action references are checked together.
44
44
 
45
45
  ## Bundles and packaging
@@ -1,9 +1,9 @@
1
- # Quickstart: a schema 5.0 plugin
1
+ # Quickstart: a schema 6.0 plugin
2
2
 
3
3
  ## Install and scaffold
4
4
 
5
5
  ```bash
6
- uv add nutria-plugin==0.5.0
6
+ uv add nutria-plugin==0.6.1
7
7
  nutria-plugin new inventory-lookup --name "Inventory Lookup"
8
8
  ```
9
9
 
@@ -11,7 +11,7 @@ nutria-plugin new inventory-lookup --name "Inventory Lookup"
11
11
 
12
12
  ```json
13
13
  {
14
- "schema_version": "5.0",
14
+ "schema_version": "6.0",
15
15
  "id": "inventory-lookup",
16
16
  "name": "Inventory Lookup",
17
17
  "version": "0.1.0",
@@ -26,6 +26,7 @@ nutria-plugin new inventory-lookup --name "Inventory Lookup"
26
26
  "description": "Read current stock for one SKU.",
27
27
  "domains": ["products"],
28
28
  "effect": "read",
29
+ "effect_scope": "world",
29
30
  "tool": "get_stock",
30
31
  "connection_id": "warehouse",
31
32
  "requirements": {
@@ -37,7 +38,8 @@ nutria-plugin new inventory-lookup --name "Inventory Lookup"
37
38
  "produces": [{
38
39
  "result_path": ".stock",
39
40
  "resource_type": "warehouse.stock",
40
- "output_name": "stock"
41
+ "output_name": "stock",
42
+ "data_class": "non_personal"
41
43
  }]
42
44
  }],
43
45
  "world_providers": [{
@@ -1,6 +1,6 @@
1
1
  # Reviewable actions and external writes
2
2
 
3
- SDK 0.5.0 schema 5.0 defines one reviewable-action architecture:
3
+ SDK 0.6.0 schema 6.0 defines one reviewable-action architecture:
4
4
 
5
5
  ```text
6
6
  ChatBotNutralia -> task context, encrypted draft, revision, approval, idempotency, receipts