nutria-plugin 0.4.2__tar.gz → 0.6.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.
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/CHANGELOG.md +31 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/PKG-INFO +9 -5
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/README.md +7 -4
- nutria_plugin-0.6.0/docs/capability-authoring.md +134 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/docs/connection-types.md +13 -11
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/docs/index.md +5 -3
- nutria_plugin-0.6.0/docs/manifest.md +167 -0
- nutria_plugin-0.6.0/docs/migration-6.0.md +32 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/docs/python-api.md +2 -2
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/docs/quickstart.md +7 -4
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/docs/reviewable-actions.md +1 -1
- nutria_plugin-0.6.0/docs/skill-format.md +203 -0
- nutria_plugin-0.6.0/examples/my-first-plugin/plugin.json +65 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/pyproject.toml +2 -1
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/src/nutria_plugin/__init__.py +38 -2
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/src/nutria_plugin/bundle.py +14 -4
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/src/nutria_plugin/capabilities.py +107 -21
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/src/nutria_plugin/cli.py +18 -0
- nutria_plugin-0.6.0/src/nutria_plugin/domains.py +44 -0
- nutria_plugin-0.6.0/src/nutria_plugin/hierarchy.py +135 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/src/nutria_plugin/manifest.py +1 -1
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/src/nutria_plugin/mcp_results.py +49 -0
- nutria_plugin-0.6.0/src/nutria_plugin/migrate.py +72 -0
- nutria_plugin-0.6.0/src/nutria_plugin/operation_facts.py +74 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/src/nutria_plugin/packaging.py +4 -1
- nutria_plugin-0.6.0/src/nutria_plugin/skills.py +44 -0
- nutria_plugin-0.6.0/tests/__init__.py +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/tests/test_bundle.py +4 -2
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/tests/test_capability_contracts.py +31 -13
- nutria_plugin-0.6.0/tests/test_contract_vnext.py +286 -0
- nutria_plugin-0.6.0/tests/test_hierarchy.py +185 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/tests/test_manifest.py +16 -7
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/tests/test_reviewable_actions.py +27 -12
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/tests/test_signing.py +1 -1
- nutria_plugin-0.6.0/tests/test_skill_format_docs.py +17 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/uv.lock +58 -1
- nutria_plugin-0.4.2/docs/manifest.md +0 -86
- nutria_plugin-0.4.2/docs/skill-format.md +0 -201
- nutria_plugin-0.4.2/examples/my-first-plugin/plugin.json +0 -14
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/.github/workflows/publish.yml +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/.gitignore +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/docs/admin-extensions.md +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/docs/admin-flows.md +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/docs/cli.md +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/docs/security.md +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/examples/my-first-plugin/README.md +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/examples/my-first-plugin/hooks/hooks.json +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/examples/my-first-plugin/settings.schema.json +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/src/nutria_plugin/signing.py +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/tests/test_cli.py +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/tests/test_mcp_results.py +0 -0
- {nutria_plugin-0.4.2 → nutria_plugin-0.6.0}/tests/test_packaging.py +0 -0
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
Breaking: manifest schema 6.0 (5.0 is rejected). See `docs/migration-6.0.md`.
|
|
6
|
+
|
|
7
|
+
- Add required `effect_scope` (`agent_local`, `internal_state`, `lifecycle`, `world`),
|
|
8
|
+
orthogonal to `effect`.
|
|
9
|
+
- Make completion explicit: every non-read capability declares `evidence: none` or
|
|
10
|
+
`evidence: declared` with `receipts`, `basis` and `targets`. Hosts no longer synthesize
|
|
11
|
+
write receipts. Reads cannot declare completion.
|
|
12
|
+
- Replace input `sensitivity` with `data_class` (six classes) on inputs and outputs.
|
|
13
|
+
- Add `OperationFacts` and `validate_operation_facts`: handlers report facts; the host
|
|
14
|
+
classifies. Proves a declared completion is producible.
|
|
15
|
+
- Reject skill frontmatter `triggers` (new `SkillFrontmatter`), in bundles too.
|
|
16
|
+
- Add `nutria-plugin migrate` (5.0 to 6.0 with review report).
|
|
17
|
+
- New validators: external writes live in the `world` scope, model-exposed world writes
|
|
18
|
+
need declared evidence and idempotency, agent-local capabilities cannot declare evidence.
|
|
19
|
+
- Add provider-neutral hierarchical attribute operations (`nutria_plugin.hierarchy`):
|
|
20
|
+
`OperationScope` (`self`, `selected_children`, `all_children`), `AttributeOperation` (with
|
|
21
|
+
current-operation `overrides`), `apply_attribute_operation` (reference semantics: a global assignment
|
|
22
|
+
replaces earlier child values; exceptions are not durable), `EffectiveAttributeState` (canonical
|
|
23
|
+
readback with factual `provider_representation`) and the optional capability field
|
|
24
|
+
`hierarchical_attributes`. `TargetFact` gains optional `effective_values` and
|
|
25
|
+
`provider_representation`. Additive: no existing 6.0 manifest changes meaning.
|
|
26
|
+
|
|
27
|
+
## 0.5.0
|
|
28
|
+
|
|
29
|
+
- Replace manifest schema 4.0 with schema 5.0.
|
|
30
|
+
- Require every capability to declare one or more stable `CapabilityDomain`
|
|
31
|
+
identifiers.
|
|
32
|
+
- Export the shared domain registry and reject unknown or duplicate domains.
|
|
33
|
+
|
|
3
34
|
## 0.4.2
|
|
4
35
|
|
|
5
36
|
- Add the generic `requires_provenance` input-binding semantic while keeping
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: nutria-plugin
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
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.
|
|
25
|
+
Release `0.6.0` 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.
|
|
38
|
+
uv add nutria-plugin==0.6.0
|
|
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
|
|
53
|
+
## Minimal schema 6.0 manifest
|
|
53
54
|
|
|
54
55
|
```json
|
|
55
56
|
{
|
|
56
|
-
"schema_version": "
|
|
57
|
+
"schema_version": "6.0",
|
|
57
58
|
"id": "my-workspace-plugin",
|
|
58
59
|
"name": "My Workspace Plugin",
|
|
59
60
|
"version": "0.1.0",
|
|
@@ -66,7 +67,9 @@ settings schema and assets.
|
|
|
66
67
|
"id": "workspace.search",
|
|
67
68
|
"title": "Search workspace",
|
|
68
69
|
"description": "Read matching workspace resources.",
|
|
70
|
+
"domains": ["products"],
|
|
69
71
|
"effect": "read",
|
|
72
|
+
"effect_scope": "world",
|
|
70
73
|
"tool": "search_workspace",
|
|
71
74
|
"connection_id": "workspace",
|
|
72
75
|
"requirements": {
|
|
@@ -79,6 +82,7 @@ settings schema and assets.
|
|
|
79
82
|
"result_path": ".items",
|
|
80
83
|
"resource_type": "workspace.item",
|
|
81
84
|
"output_name": "items",
|
|
85
|
+
"data_class": "non_personal",
|
|
82
86
|
"many": true
|
|
83
87
|
}]
|
|
84
88
|
}],
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
SDK for building, validating, signing, and packaging Nutria plugins.
|
|
4
4
|
|
|
5
|
-
Release `0.
|
|
5
|
+
Release `0.6.0` 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.
|
|
18
|
+
uv add nutria-plugin==0.6.0
|
|
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
|
|
33
|
+
## Minimal schema 6.0 manifest
|
|
34
34
|
|
|
35
35
|
```json
|
|
36
36
|
{
|
|
37
|
-
"schema_version": "
|
|
37
|
+
"schema_version": "6.0",
|
|
38
38
|
"id": "my-workspace-plugin",
|
|
39
39
|
"name": "My Workspace Plugin",
|
|
40
40
|
"version": "0.1.0",
|
|
@@ -47,7 +47,9 @@ settings schema and assets.
|
|
|
47
47
|
"id": "workspace.search",
|
|
48
48
|
"title": "Search workspace",
|
|
49
49
|
"description": "Read matching workspace resources.",
|
|
50
|
+
"domains": ["products"],
|
|
50
51
|
"effect": "read",
|
|
52
|
+
"effect_scope": "world",
|
|
51
53
|
"tool": "search_workspace",
|
|
52
54
|
"connection_id": "workspace",
|
|
53
55
|
"requirements": {
|
|
@@ -60,6 +62,7 @@ settings schema and assets.
|
|
|
60
62
|
"result_path": ".items",
|
|
61
63
|
"resource_type": "workspace.item",
|
|
62
64
|
"output_name": "items",
|
|
65
|
+
"data_class": "non_personal",
|
|
63
66
|
"many": true
|
|
64
67
|
}]
|
|
65
68
|
}],
|
|
@@ -0,0 +1,134 @@
|
|
|
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
|
+
## 6. Hierarchical attribute operations
|
|
88
|
+
|
|
89
|
+
An entity can own child entities (variants of an item, ads of a campaign, establishments of an
|
|
90
|
+
organization, child resources of a configuration). The Agent decides **entity, children, attribute, value
|
|
91
|
+
and scope**; the provider materializes it. The contract is domain-neutral (`nutria_plugin.hierarchy`):
|
|
92
|
+
|
|
93
|
+
| Scope | Meaning |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| `self` | The value applies to the entity itself only. |
|
|
96
|
+
| `selected_children` | The value applies to exactly the listed children (`targets`). |
|
|
97
|
+
| `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. |
|
|
98
|
+
|
|
99
|
+
* `overrides` are explicit exceptions of **this operation only** (`all_children` with other values for named
|
|
100
|
+
children, e.g. creation "all at V, but B at X"). They are never remembered: a later `all_children`
|
|
101
|
+
operation replaces them. Do not model durable inheritance.
|
|
102
|
+
* A capability declares what it supports per attribute with `hierarchical_attributes`
|
|
103
|
+
(`[{"attribute": "...", "scopes": ["all_children", ...]}]`). Different attributes may declare different
|
|
104
|
+
scopes. Only write capabilities may declare it; an attribute appears once.
|
|
105
|
+
* `apply_attribute_operation` is the reference semantics (the oracle for contract tests);
|
|
106
|
+
`EffectiveAttributeState` is the canonical readback.
|
|
107
|
+
* **Readback is the effective state**, not the provider's physical layout. If the provider stores a value on
|
|
108
|
+
the children and leaves the parent blank, report the effective values per child and put the physical
|
|
109
|
+
parent value in `provider_representation` (observability only). The Agent must never need to know how the
|
|
110
|
+
provider stores it.
|
|
111
|
+
* Facts stay facts: report per-child `TargetFact.effective_values` and, on the parent target,
|
|
112
|
+
`provider_representation`. Completion is still concluded by the Host from the declared contract, and the
|
|
113
|
+
Agent decides whether the Objective is complete.
|
|
114
|
+
|
|
115
|
+
## 7. Validation errors
|
|
116
|
+
|
|
117
|
+
| Error | Fix |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| `non-read capabilities must declare completion explicitly` | Add `completion` (`declared` or `none`). |
|
|
120
|
+
| `read capabilities observe; they must not declare completion` | Remove `completion` from reads. |
|
|
121
|
+
| `external_write capabilities must have effect_scope 'world'` | Set `effect_scope: "world"`. |
|
|
122
|
+
| `agent_local capabilities cannot declare completion evidence` | Use `evidence: "none"` or another scope. |
|
|
123
|
+
| `model-selectable world writes require declared completion evidence` | Declare receipts and basis. |
|
|
124
|
+
| `model-selectable world writes require execution idempotency` | Add `idempotency.required_for_execution`. |
|
|
125
|
+
| `model-selectable external writes require prepared_action` | Add a `prepared_action` contract. |
|
|
126
|
+
| `declared completion evidence requires receipts` / `... a basis` | Fill both. |
|
|
127
|
+
| `completion evidence 'none' must not declare receipts or basis` | Remove them. |
|
|
128
|
+
| `completion receipts must be stable lowercase identifiers` | Use ids like `email.reply.sent`. |
|
|
129
|
+
| `model-selectable reads require declared outputs` | Declare `produces` with `data_class`. |
|
|
130
|
+
| `model-selectable writes require declared inputs` | Declare every business input with `data_class`. |
|
|
131
|
+
| `a confirmed mutation cannot come from a failed or inapplicable outcome` | Fix the reported facts. |
|
|
132
|
+
| `verified requires a mutation fact other than none` | Report the mutation you verified. |
|
|
133
|
+
| `partial operations must report at least two targets` | Report per-target outcomes. |
|
|
134
|
+
| `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
|
|
21
|
-
|
|
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
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
##
|
|
28
|
+
## Capability effects
|
|
28
29
|
|
|
29
|
-
Every
|
|
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
|
-
|
|
|
33
|
+
| Effect | Description |
|
|
32
34
|
|-------|-------------|
|
|
33
|
-
| `read` | Read-only query
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
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.
|
|
3
|
+
Developer reference for SDK `0.6.0` and manifest schema `6.0`.
|
|
4
4
|
|
|
5
5
|
| Document | Purpose |
|
|
6
6
|
|---|---|
|
|
7
|
-
| [quickstart.md](quickstart.md) | Build a strict schema
|
|
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.4.2` and manifest schema `4.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
|
|
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, and provider topology. SDK 0.6.0 accepts exactly schema
|
|
5
|
+
`5.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.
|
|
3
|
+
SDK 0.6.0 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 `
|
|
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
|
|
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.
|
|
6
|
+
uv add nutria-plugin==0.6.0
|
|
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": "
|
|
14
|
+
"schema_version": "6.0",
|
|
15
15
|
"id": "inventory-lookup",
|
|
16
16
|
"name": "Inventory Lookup",
|
|
17
17
|
"version": "0.1.0",
|
|
@@ -24,7 +24,9 @@ nutria-plugin new inventory-lookup --name "Inventory Lookup"
|
|
|
24
24
|
"id": "warehouse.stock.read",
|
|
25
25
|
"title": "Read stock",
|
|
26
26
|
"description": "Read current stock for one SKU.",
|
|
27
|
+
"domains": ["products"],
|
|
27
28
|
"effect": "read",
|
|
29
|
+
"effect_scope": "world",
|
|
28
30
|
"tool": "get_stock",
|
|
29
31
|
"connection_id": "warehouse",
|
|
30
32
|
"requirements": {
|
|
@@ -36,7 +38,8 @@ nutria-plugin new inventory-lookup --name "Inventory Lookup"
|
|
|
36
38
|
"produces": [{
|
|
37
39
|
"result_path": ".stock",
|
|
38
40
|
"resource_type": "warehouse.stock",
|
|
39
|
-
"output_name": "stock"
|
|
41
|
+
"output_name": "stock",
|
|
42
|
+
"data_class": "non_personal"
|
|
40
43
|
}]
|
|
41
44
|
}],
|
|
42
45
|
"world_providers": [{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Reviewable actions and external writes
|
|
2
2
|
|
|
3
|
-
SDK 0.
|
|
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
|