@mhome/app-facade-protocol 1.183.1 → 1.187.0
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.
- package/contract/automation-presentation-v1.md +24 -12
- package/contract/automation-v1.md +2 -1
- package/contract/chat-reference-v1.md +150 -0
- package/contract/entity-extensions-v1.md +125 -32
- package/contract/reference-presentation-v1.md +3 -2
- package/contract/resource-read-v1.md +21 -9
- package/contract/suggestion-v1.md +22 -5
- package/fixtures/automation-failure-codes.json +215 -0
- package/fixtures/chat-reference-projection.conformance.json +305 -0
- package/fixtures/suggestion.conformance.json +165 -0
- package/fixtures/suggestion.migration.json +9 -0
- package/manifest/app-facade.v1.json +5 -3
- package/manifest/authorization.v1.json +4 -2
- package/manifest/host-provision-targets.v1.json +1 -1
- package/manifest/hub-targets.v1.json +1 -1
- package/manifest/pod-targets.v1.json +1 -1
- package/manifest/routing.v1.json +1 -1
- package/manifest/targets.v1.json +1 -1
- package/package.json +1 -1
- package/protocol.json +1 -1
- package/schema/automation-presentation.v1.schema.json +1 -1
- package/schema/suggestion.v1.schema.json +68 -0
|
@@ -43,14 +43,14 @@ not zero. Overview and placements are separate on-demand reads. Snapshot panels
|
|
|
43
43
|
continue using `/app/automation/snapshot/list` only when opened.
|
|
44
44
|
|
|
45
45
|
Automation detail includes `runnable` from its already-loaded definition; Group
|
|
46
|
-
entries omit it. Automation status
|
|
46
|
+
entries omit it. Automation status exposes the current revision's `lastExecution`, when known,
|
|
47
47
|
and temporary `expireAt` from creation/last-run timestamps. Ordinary configuration
|
|
48
48
|
editor initialization supplies the metadata it already loaded, so subsequent
|
|
49
49
|
runtime hydration only needs status.
|
|
50
50
|
|
|
51
51
|
## Selected summaries and configuration editing
|
|
52
52
|
|
|
53
|
-
`/app/presentation/automation/summaries/get` accepts the same
|
|
53
|
+
`/app/presentation/automation/summaries/get` accepts the same selected
|
|
54
54
|
`{ids}` as names. It returns `{items:[{requestedId,found,resource}]}` in normalized input
|
|
55
55
|
order. A found resource contains ListItem fields plus `automationId`, `temp`,
|
|
56
56
|
nullable `lastRunAt` and `expireAt`. Missing items omit resource. It supports
|
|
@@ -63,7 +63,7 @@ also uses metadata rather than downloading authored source.
|
|
|
63
63
|
| `/app/presentation/automation/overview/init` | `{automationId?,inspireId?,inspireVersion?,snapshotId?,args?}` | Existing editor session, required installs, AutomationOverview and already-loaded metadata. Snapshot takes precedence over existing program, then Inspire. Uses the authenticated Client and existing staged-Inspire developer session. |
|
|
64
64
|
| `/app/presentation/automation/overview/config/provide` | `{sessionId,var,input}` | Existing option query and editor revision. |
|
|
65
65
|
| `/app/presentation/automation/overview/config/update` | `{sessionId,var,inputs?,widgetize?}` | Existing config evaluation, diagnostics and revision. |
|
|
66
|
-
| `/app/presentation/automation/overview/save` | `{sessionId,automationId?,inspireId?,inspireVersion?,snapshotId?,preferredName?,debug?,addCard?,canvasIds?}` | `{automationId,runnable,enabled}`. Existing single-save guard, Client ownership, prepare/save/complete revision checks and internal normalized-source persistence. Legacy snapshotId/addCard/canvasIds are accepted but do not perform placement; frontend creates placements separately. |
|
|
66
|
+
| `/app/presentation/automation/overview/save` | `{sessionId,automationId?,inspireId?,inspireVersion?,snapshotId?,preferredName?,debug?,addCard?,canvasIds?}` | `{automationId,runnable,enabled?,restoreIssue?}`. Updating an existing definition preserves its previous enabled intent; restoration runs after releasing the edit lock, is fenced by the saved revision, and cannot override a newer stop. A committed save with failed/unconfirmed restoration or an unavailable post-save enabled observation returns `partial`; unknown enabled is omitted. New saves retain existing creation semantics and saving never triggers a Task Flow. Existing single-save guard, Client ownership, prepare/save/complete revision checks and internal normalized-source persistence. Legacy snapshotId/addCard/canvasIds are accepted but do not perform placement; frontend creates placements separately. |
|
|
67
67
|
| `/app/presentation/automation/overview/cancel` | `{sessionId}` | Canonical acknowledgement without data. Existing Client ownership check and session cleanup. |
|
|
68
68
|
| `/app/presentation/automation/copy` | `{automationId,name?}` | `{automationId,runnable,enabled}`. Copies the existing script/template metadata using the internal save operation. |
|
|
69
69
|
| `/app/presentation/automation/enroll` | `{automationId,name?}` | `{automationId,runnable,enabled}`. Existing enrollment behavior. |
|
|
@@ -103,12 +103,24 @@ The small activity summary is independent of detailed diagnostic retention and d
|
|
|
103
103
|
not add an activity-history row. Suppression follows the existing runtime outcome;
|
|
104
104
|
there is no separate suppressed terminal state. The durable `corrupted` flag is removed.
|
|
105
105
|
|
|
106
|
-
`lastExecution.failureCode` is optional
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
106
|
+
`lastExecution.failureCode` is an optional best-effort reason for a committed
|
|
107
|
+
`FAILED` outcome. It does not determine success/failure and has no companion stage
|
|
108
|
+
field. Known raw operation codes are retained; missing, malformed, ambiguous or
|
|
109
|
+
unknown reasons are omitted. Consumers must fall back to the ordinary outcome
|
|
110
|
+
label for absent or unrecognized codes. The shared cases in
|
|
111
|
+
`fixtures/automation-failure-codes.json` define current recognized codes.
|
|
112
|
+
|
|
113
|
+
`SUPPRESSED` means the whole Automation was rejected at its entry/resume gate.
|
|
114
|
+
`STEP_SUPPRESSED` means an unhandled action suppression caused execution to fail;
|
|
115
|
+
the diagnostic retains its original `SUPPRESSED` code. A resume gate can reject a
|
|
116
|
+
run after earlier actions succeeded. Neither classification claims that nothing
|
|
117
|
+
ran. Successful continue/fallback paths and successful Group commands with failed
|
|
118
|
+
members remain successful and have no summary failure code.
|
|
119
|
+
|
|
120
|
+
Sequential/repeat failures propagate the unhandled action reason. An exhausted
|
|
121
|
+
alternative uses its last attempted branch. Parallel execution retains a reason
|
|
122
|
+
only when exactly one branch failed. Selected then/else actions are covered;
|
|
123
|
+
internal context/condition evaluation and wait setup/cleanup may remain generic. An
|
|
124
|
+
unclassified fatal runtime fault must not reuse a prior handled action's reason.
|
|
125
|
+
Old generated Plans can remain generic until normal regeneration; no automatic
|
|
126
|
+
migration is required. The summary is independent of diagnostic-log retention.
|
|
@@ -27,7 +27,8 @@ Generated Twin and Group programs remain internal resources.
|
|
|
27
27
|
|
|
28
28
|
Inputs are closed objects. The schema is `schema/automation.v1.schema.json`.
|
|
29
29
|
|
|
30
|
-
For `/app/automation/save
|
|
30
|
+
For `/app/automation/save`, `/app/presentation/automation/overview/save` and
|
|
31
|
+
`/app/automation/snapshot/rollback`, the definition
|
|
31
32
|
is committed before the optional attempt to restore the enabled state. If that
|
|
32
33
|
attempt is rejected or unconfirmed, the Facade returns `partial` with the
|
|
33
34
|
Automation ID and `restoreIssue` (`failed` or `unconfirmed`). Rollback also
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Chat reference protocol (v1)
|
|
2
|
+
|
|
3
|
+
This contract defines the single canonical text syntax for inline chat object
|
|
4
|
+
references, internal App route links, and interactive shortcut suggestions across
|
|
5
|
+
Agent prompts, App UIs (Default and Compact), speech playback (TTS), and external
|
|
6
|
+
Messaging channels (Core and Cloud).
|
|
7
|
+
|
|
8
|
+
This contract applies to conversational text only. Two distinct platform
|
|
9
|
+
contracts remain independent and unchanged:
|
|
10
|
+
|
|
11
|
+
- Private media attachments: ``
|
|
12
|
+
- Backend Automation `waitUserInput` form DSL: `<MeowInput var="$x">...</MeowInput>`
|
|
13
|
+
and server-generated inert `<input ...>` description references.
|
|
14
|
+
|
|
15
|
+
## Canonical wire syntax
|
|
16
|
+
|
|
17
|
+
All new producers (Agent prompts, chat input editors, and drag-and-drop sources)
|
|
18
|
+
emit standard Markdown links using the `meow:` URI scheme:
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
[label](meow://<kind>?<query>)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
No new producer may emit `<MeowEntity>`, `<MeowAutomation>`, `<MeowWidget>`, or
|
|
25
|
+
`<MeowShortcutSuggestion>` XML tags.
|
|
26
|
+
|
|
27
|
+
| `kind` | Canonical format | Required query params | Optional query params | Scope |
|
|
28
|
+
| --- | --- | --- | --- | --- |
|
|
29
|
+
| `entity` | `[label](meow://entity?type=<T>&id=<ID>)` | `type`, `id` | — | Devices (`basic.device.Device`), ordinary entities, and groups (`id=g:...`) |
|
|
30
|
+
| `automation` | `[label](meow://automation?id=<ID>)` | `id` | — | Regular/temporary automations and automation groups |
|
|
31
|
+
| `widget` | `[label](meow://widget?type=<T>&id=<ID>)` | `type`, `id` | `automation` | Global and automation-owned widgets (aliases `data`, `button`, `circadian` normalize to `basic.widget.*`) |
|
|
32
|
+
| `route` | `[label](meow://route?url=<base64url>)` | `url` | — | In-app relative path (decoded path must start with `/` and not `//`) |
|
|
33
|
+
| `shortcut` | `[prompt](meow://shortcut?phrase=<P>)` | `phrase` | — | Replaces `<MeowShortcutSuggestion>`; interactive shortcut creation prompt |
|
|
34
|
+
| `suggestion` | `[label](meow://suggestion?id=<ID>)` | `id` | — | Reserved for Suggestion references |
|
|
35
|
+
|
|
36
|
+
## Encoding and decoding rules
|
|
37
|
+
|
|
38
|
+
### Serialization (encode)
|
|
39
|
+
|
|
40
|
+
1. **Visible `label`**:
|
|
41
|
+
- Normalize `\r` and `\n` to spaces and trim surrounding whitespace.
|
|
42
|
+
- Escape Markdown link-label special characters (`\`, `[`, `]`).
|
|
43
|
+
- Never substitute a raw opaque `id` when a human-readable label is absent.
|
|
44
|
+
Use a safe generic fallback by kind (`device`, `entity`, `automation`,
|
|
45
|
+
`widget`, `route`, `shortcut`, `suggestion`, or `item`).
|
|
46
|
+
2. **Query parameter encoding (RFC 3986 URI percent-encoding)**:
|
|
47
|
+
- Encode every parameter value with `encodeURIComponent` plus `(` -> `%28`
|
|
48
|
+
and `)` -> `%29` so parentheses inside opaque IDs or phrases never close
|
|
49
|
+
the Markdown link destination prematurely.
|
|
50
|
+
- Spaces encode as `%20` (not `+`); literal `+` encodes as `%2B`; `&` as
|
|
51
|
+
`%26`; `%` as `%25`; `#` as `%23`; `=` as `%3D`.
|
|
52
|
+
|
|
53
|
+
### Actionable parsing (decode)
|
|
54
|
+
|
|
55
|
+
Actionable parsers (App click navigation, Lexical mention import, Compact
|
|
56
|
+
operation targets) separate syntax recognition from business decoding:
|
|
57
|
+
|
|
58
|
+
1. **Scheme and structure**:
|
|
59
|
+
- Accept only `meow://` (case-insensitive scheme and host/kind).
|
|
60
|
+
- Reject credentials (`user@host`), ports, extra path segments, or fragments.
|
|
61
|
+
- Reject duplicate query keys or missing/blank required parameters.
|
|
62
|
+
2. **Strict single-pass RFC 3986 query decoding**:
|
|
63
|
+
- Split the raw query string on `&` and the first `=`, then percent-decode
|
|
64
|
+
each parameter value **once** as UTF-8.
|
|
65
|
+
- Do **not** use `application/x-www-form-urlencoded` decoding (`URLSearchParams`),
|
|
66
|
+
which silently converts bare `+` into spaces and corrupts opaque IDs
|
|
67
|
+
containing literal `+`.
|
|
68
|
+
- Reject malformed percent sequences or invalid UTF-8 sequences.
|
|
69
|
+
3. **Original-text offsets**:
|
|
70
|
+
- Scanners returning match spans (`start`, `end`) must compute indices on the
|
|
71
|
+
original input string without pre-rewriting syntax.
|
|
72
|
+
4. **Visible label preservation**:
|
|
73
|
+
- Preserve the link's human-readable `label` as initial/fallback display text
|
|
74
|
+
until asynchronous name hydration resolves, without mutating the Markdown
|
|
75
|
+
source string.
|
|
76
|
+
5. **Bounded tolerance for `meow://shortcut?phrase=...`**:
|
|
77
|
+
- Accept standard percent-encoded destinations (`meow://shortcut?phrase=Office%20lights`),
|
|
78
|
+
CommonMark angle-bracket destinations (`<meow://shortcut?phrase=Office lights>`),
|
|
79
|
+
and a bounded single-line balanced-parenthesis fallback outside code spans
|
|
80
|
+
and code blocks if a model omits `%20` in `meow://shortcut?phrase=...`.
|
|
81
|
+
|
|
82
|
+
## Legacy XML read-only compatibility
|
|
83
|
+
|
|
84
|
+
Persisted historical messages and legacy clipboard payloads may contain:
|
|
85
|
+
|
|
86
|
+
- `<MeowEntity type="..." name="..." id="..." ...></MeowEntity>`
|
|
87
|
+
- `<MeowAutomation id="..." name="..."></MeowAutomation>`
|
|
88
|
+
- `<MeowWidget type="..." id="..." name="..." [automation="..."]></MeowWidget>`
|
|
89
|
+
- `<MeowShortcutSuggestion shortcut="...">prompt</MeowShortcutSuggestion>`
|
|
90
|
+
|
|
91
|
+
Consumers retain read-only parsing compatibility for these historical forms:
|
|
92
|
+
|
|
93
|
+
- Decode XML attribute values with HTML entity decoding **once**; do not
|
|
94
|
+
percent-decode legacy XML `id` values.
|
|
95
|
+
- Treat legacy `name` attributes strictly as plain text (never re-interpret as
|
|
96
|
+
HTML or nested Markdown links/actions).
|
|
97
|
+
- Never fall back to raw `id` when `name` is empty; use the safe generic kind
|
|
98
|
+
label.
|
|
99
|
+
|
|
100
|
+
## Per-surface capability matrix
|
|
101
|
+
|
|
102
|
+
| Surface | Supported actionable kinds | Unsupported / unknown `meow://` kinds |
|
|
103
|
+
| --- | --- | --- |
|
|
104
|
+
| Lexical editor & drag-and-drop | `entity`, `automation`, `widget` become `MentionNode` | Kept as canonical plain text; never coerced into `entity` mentions |
|
|
105
|
+
| Default App assistant reply | `entity`, `automation`, `widget` (`<MentionChip>` with batched `getNames`), `route` (opt-in `<AppRouteLink>`), `shortcut` (block `<ChatShortcutSuggestion>` card) | Rendered as inert readable `label` (`<span>`); never falls through to raw `<a href="meow://...">` |
|
|
106
|
+
| Default App user bubble / temp text / notifications | Explicit per-caller opt-in only (e.g., `NotificationDialogCard` does not enable `route` or `shortcut` actions) | Inert readable `label` |
|
|
107
|
+
| Compact App (`default-pod`) | Supported device / automation / widget targets (without misclassifying `g:` groups) | Inert readable `label` |
|
|
108
|
+
| External Messaging (Core & Cloud) & TTS | None (non-App surface) | Universal text projection below |
|
|
109
|
+
|
|
110
|
+
## Universal non-App text projection (Messaging & TTS)
|
|
111
|
+
|
|
112
|
+
External Messaging gateways (Core Telegram, Feishu, WeChat iLink; Cloud Telegram,
|
|
113
|
+
WeChat Official) and TTS playback apply one universal projection rule across all
|
|
114
|
+
outbound exits and all visible text fields (message parts, interaction titles,
|
|
115
|
+
messages, card previews, dialog prompts, field labels/descriptions, terminal
|
|
116
|
+
replacements, action/menu/button labels, run outcomes, and simple/edited text
|
|
117
|
+
replies). Projection operates on a transient copy and never mutates persisted
|
|
118
|
+
conversations, callback tokens, form values, resource IDs, or media URIs.
|
|
119
|
+
|
|
120
|
+
Outside fenced code blocks, indented code blocks, and inline code spans:
|
|
121
|
+
|
|
122
|
+
1. Any `[label](meow://...)` link — including angle-bracket destinations,
|
|
123
|
+
reference-style `[label][ref]` + `[ref]: meow://...`, bounded unencoded-space
|
|
124
|
+
`meow://shortcut?phrase=...`, and unknown or parameter-invalid `meow://`
|
|
125
|
+
targets — projects to its inner `label` (preserving inner Markdown formatting
|
|
126
|
+
such as `**bold**`; falling back to a safe generic kind word when `label` is
|
|
127
|
+
empty). Internal reference definitions targeting `meow://...` are removed.
|
|
128
|
+
2. Autolinks `<meow://...>` never expose the internal URI; they project to the
|
|
129
|
+
safe generic kind fallback (`device`, `entity`, `automation`, `widget`,
|
|
130
|
+
`route`, `shortcut`, `suggestion`, or `item`).
|
|
131
|
+
3. Internal images `` degrade to `alt` (or safe fallback).
|
|
132
|
+
Artifact images `` are untouched.
|
|
133
|
+
4. External links (`http://`, `https://`, `mailto:`, `tg://`) and all code
|
|
134
|
+
blocks/inline code spans remain verbatim.
|
|
135
|
+
5. Legacy `<MeowShortcutSuggestion ...>inner</MeowShortcutSuggestion>` projects
|
|
136
|
+
to trimmed `inner`.
|
|
137
|
+
6. Legacy `<MeowEntity|MeowAutomation|MeowWidget ...>` projects to HTML-decoded
|
|
138
|
+
`name` (or safe generic kind fallback, never exposing `id`).
|
|
139
|
+
7. Projection is idempotent: `project(project(text)) == project(text)`.
|
|
140
|
+
|
|
141
|
+
Defense in depth: provider link formatters (such as Telegram HTML and Telegram
|
|
142
|
+
MarkdownV2) only emit clickable link markup for external schemes (`http://`,
|
|
143
|
+
`https://`, `mailto:`, `tg://`) and degrade all other schemes to plain text.
|
|
144
|
+
|
|
145
|
+
## Cross-language conformance corpus
|
|
146
|
+
|
|
147
|
+
Language-agnostic test vectors live in
|
|
148
|
+
`fixtures/chat-reference-projection.conformance.json`. JavaScript (`@pallas/domain`),
|
|
149
|
+
Rust (`messaging-gateway`), and Java (`module-runtime`) implementations must
|
|
150
|
+
agree on every vector and preserve idempotency and code/external-link invariants.
|
|
@@ -1,35 +1,128 @@
|
|
|
1
1
|
# Entity extension management
|
|
2
2
|
|
|
3
|
-
These App Facades operate on the
|
|
3
|
+
These App Facades operate on the Provider-owned standalone entity. They create no
|
|
4
4
|
second inventory and do not transfer Provider Connection data. Requests use the
|
|
5
|
-
ordinary Facade call envelope and current Space authority.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
5
|
+
ordinary Facade call envelope and authenticated current Space authority. Core
|
|
6
|
+
owns local associations; Cloud forwards local Space requests and does not create
|
|
7
|
+
native Plugin owners in Cloud Spaces.
|
|
8
|
+
|
|
9
|
+
## Reads
|
|
10
|
+
|
|
11
|
+
| Target | Input | Result |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `/app/entity/extension/get` | `entityUid` | One extension view |
|
|
14
|
+
| `/app/entity/extension/candidates` | `entityUids?`, `nodeIds?`, `cursor?`, `limit?` | `items`, `instances`, `nextCursor?` |
|
|
15
|
+
| `/app/entity/extension/list` | `nodeId`, `cursor?`, `limit?` | Existing association `items`, `nextCursor?` |
|
|
16
|
+
|
|
17
|
+
All reads require Space read access. Candidates require at least one selector;
|
|
18
|
+
providing both selects their intersection. Lists contain 1–100 distinct, nonempty
|
|
19
|
+
IDs. Selected entity reads return each requested identity and do not accept a
|
|
20
|
+
cursor. Instance scans use opaque cursors bound to tenant, Space, operation and
|
|
21
|
+
selection, with a default page size of 50 and a maximum of 100. A scan page can be
|
|
22
|
+
empty after eligibility filtering and still have `nextCursor`; callers may
|
|
23
|
+
continue it. Reading never changes an association or chooses a default instance.
|
|
24
|
+
|
|
25
|
+
An extension view contains `entityUid`, optimistic concurrency `revision`,
|
|
26
|
+
`extensionBindings`, full `capabilities`, `visibleCapabilities`, and `candidates`
|
|
27
|
+
(service ID, Node ID and full canonical capability IDs). Candidates come from
|
|
28
|
+
verified instance offers and current dependencies. A retained association is not
|
|
29
|
+
reassigned when a different candidate appears.
|
|
30
|
+
|
|
31
|
+
An entity item contains `requestedId`, `found`, optional `name`, `entityType`,
|
|
32
|
+
`sourceStatus`, `view`, `reason` and structured `problem`. Confirmed absence uses
|
|
33
|
+
`not_found`; an unreadable item uses `unavailable`. If only candidate computation
|
|
34
|
+
fails, retain the authoritative view and omit unknown `candidates`. Independent
|
|
35
|
+
read settlement follows [the resource read contract](resource-read-failures-v1.md):
|
|
36
|
+
use partial results with ID-scoped problems, fail all-unavailable selected reads,
|
|
37
|
+
and never turn authority or mandatory shared-enumeration failures into empty data.
|
|
38
|
+
|
|
39
|
+
Instance entries contain `nodeId`, `found`, and, when known, `name`, `hostName`,
|
|
40
|
+
`serviceId`, `readiness`, `connected`. Readiness is `ready`, `pending`,
|
|
41
|
+
`unavailable`, `not_extension`, or `retiring`; connectivity is independent of a
|
|
42
|
+
retained verified offer. Pending and unavailable must not be displayed as an empty
|
|
43
|
+
candidate directory. Reverse association lists retain disabled, removing and
|
|
44
|
+
deleted-source references even when the entity is no longer a candidate.
|
|
45
|
+
|
|
46
|
+
## Explicit mutations
|
|
47
|
+
|
|
48
|
+
All mutations require Space management access. Unknown input fields are rejected.
|
|
49
|
+
|
|
50
|
+
`/app/entity/extension/associate` is an add-only batch:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"items": [
|
|
55
|
+
{
|
|
56
|
+
"entityUid": "device-1",
|
|
57
|
+
"expectedRevision": 4,
|
|
58
|
+
"bindings": [
|
|
59
|
+
{ "serviceId": "camera", "nodeId": "camera-A" },
|
|
60
|
+
{ "serviceId": "analysis", "nodeId": "analysis-B" }
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Validate the entire input before side effects: 1–100 distinct entities, each with
|
|
68
|
+
its nonnegative revision and 1–16 distinct services with explicit nonempty Node
|
|
69
|
+
IDs. All selections for one entity commit atomically; entities settle
|
|
70
|
+
independently. Existing service owners cannot be overwritten. At commit, Core
|
|
71
|
+
checks the entity revision, source generation, runtime projection generation,
|
|
72
|
+
verified offer revision and contribution of every selected service.
|
|
73
|
+
|
|
74
|
+
The result contains `items`: each has `entityUid`, `outcome` (`committed`,
|
|
75
|
+
`rejected`, or `unknown`), a committed `view` or a structured `problem`. The Facade
|
|
76
|
+
status is success only when all items committed, otherwise partial, including
|
|
77
|
+
when all are rejected/unknown. Unknown means the backend cannot confirm the
|
|
78
|
+
write outcome; it does not authorize replay. Refresh before another explicit
|
|
79
|
+
selection. Instance notifications are coalesced after the batch.
|
|
80
|
+
|
|
81
|
+
`/app/entity/extension/change` takes `entityUid`, `serviceId`,
|
|
82
|
+
`expectedRevision`, and `action`:
|
|
83
|
+
|
|
84
|
+
| Action | Additional input | Effect |
|
|
85
|
+
| --- | --- | --- |
|
|
86
|
+
| `add` | `nodeId` | Associate an explicitly selected eligible instance |
|
|
87
|
+
| `disable` | None | Pause, preserving owner, lifetime and data |
|
|
88
|
+
| `enable` | None | Resume the same eligible owner and lifetime |
|
|
89
|
+
| `remove` | None | Fence execution, clean extension data, then release association |
|
|
90
|
+
| `unlink` | `bindingId` | Release the exact removing lifetime without confirmed cleanup |
|
|
91
|
+
|
|
92
|
+
Only add accepts `nodeId`; only unlink accepts `bindingId`. Every retained
|
|
93
|
+
binding (`enabled`, `disabled`, `removing`) requires both `nodeId` and `bindingId`.
|
|
94
|
+
No ownerless opt-out or default-instance policy exists. Remove and unlink delete
|
|
95
|
+
the service key; later add allocates a fresh lifetime. Stale revisions and old
|
|
96
|
+
acknowledgements cannot mutate a newer lifetime. Group projections are not
|
|
97
|
+
standalone extension targets.
|
|
98
|
+
|
|
99
|
+
Change returns the extension view and, for remove/unlink, `cleanup`:
|
|
100
|
+
`confirmed`, `pending`, optional `problem`. Successful detach acknowledgement
|
|
101
|
+
means confirmed cleanup. Failed/unreachable cleanup persists `removing` and
|
|
102
|
+
returns partial with pending cleanup. Explicit unlink returns success with
|
|
103
|
+
`confirmed: false`, `pending: false`: old data deletion is unconfirmed. It is
|
|
104
|
+
permitted only after the user chooses that consequence for the exact removing
|
|
105
|
+
binding. Reassignment is remove/unlink followed by a separate add.
|
|
106
|
+
|
|
107
|
+
## Instance retirement and onboarding
|
|
108
|
+
|
|
109
|
+
Plugin removal first persists local profile `lifecycle: retiring`, fencing new
|
|
110
|
+
admission. It drains all references, including disabled and deleted-source ones,
|
|
111
|
+
while retaining authentication so the owner can reconnect to acknowledge cleanup.
|
|
112
|
+
The partial removal result returns `disabled: false`, `lifecycle: retiring`, and
|
|
113
|
+
`remainingAssociations` while references remain. Retrying removal resumes the
|
|
114
|
+
same operation. Only after no references remain may identity revocation,
|
|
115
|
+
disconnection and profile deletion finish. No network call runs inside a database
|
|
116
|
+
transaction. Restart does not reset retirement.
|
|
117
|
+
|
|
118
|
+
Device onboarding uses selected-entity candidates after synchronization and room
|
|
119
|
+
assignment. Plugin onboarding uses only confirmed successful Node IDs to discover
|
|
120
|
+
compatible existing entities. Both flows begin with no selections, support skip,
|
|
121
|
+
and preserve completed onboarding if this optional step fails. Permanent entity
|
|
122
|
+
and instance management use the same Facades. Agent/CLI/UI adapters present and
|
|
123
|
+
forward choices; they do not reproduce backend matching or mutation orchestration.
|
|
124
|
+
|
|
125
|
+
Full support remains the invocation contract. Visible support applies authored
|
|
126
|
+
shadow solely to presentation. Pure Plan composites can still be derived without
|
|
127
|
+
an instance. Installation, inventory refresh and reconnect never implicitly add
|
|
128
|
+
an instance-backed association.
|
|
@@ -31,5 +31,6 @@ rows and group capability resolution; this contract does not promise one DB quer
|
|
|
31
31
|
|
|
32
32
|
The UI lazily caches types and items by Space/type and merges in-flight reads.
|
|
33
33
|
Search remains client-side. Failed requests are retryable and are not successful
|
|
34
|
-
empty catalogs. Space changes discard late results.
|
|
35
|
-
|
|
34
|
+
empty catalogs. Space changes discard late results. Chat reference serialization
|
|
35
|
+
and decoding follow [chat-reference-v1.md](./chat-reference-v1.md). Legacy
|
|
36
|
+
`/reference/*` request routes are retired.
|
|
@@ -159,15 +159,27 @@ The small activity summary is independent of detailed diagnostic retention and d
|
|
|
159
159
|
not add an activity-history row. Suppression follows the existing runtime outcome;
|
|
160
160
|
there is no separate suppressed terminal state. The durable `corrupted` flag is removed.
|
|
161
161
|
|
|
162
|
-
`lastExecution.failureCode` is optional
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
162
|
+
`lastExecution.failureCode` is an optional best-effort reason for a committed
|
|
163
|
+
`FAILED` outcome. It does not determine success/failure and has no companion stage
|
|
164
|
+
field. Known raw operation codes are retained; missing, malformed, ambiguous or
|
|
165
|
+
unknown reasons are omitted. Consumers must fall back to the ordinary outcome
|
|
166
|
+
label for absent or unrecognized codes. The shared cases in
|
|
167
|
+
`fixtures/automation-failure-codes.json` define current recognized codes.
|
|
168
|
+
|
|
169
|
+
`SUPPRESSED` means the whole Automation was rejected at its entry/resume gate.
|
|
170
|
+
`STEP_SUPPRESSED` means an unhandled action suppression caused execution to fail;
|
|
171
|
+
the diagnostic retains its original `SUPPRESSED` code. A resume gate can reject a
|
|
172
|
+
run after earlier actions succeeded. Neither classification claims that nothing
|
|
173
|
+
ran. Successful continue/fallback paths and successful Group commands with failed
|
|
174
|
+
members remain successful and have no summary failure code.
|
|
175
|
+
|
|
176
|
+
Sequential/repeat failures propagate the unhandled action reason. An exhausted
|
|
177
|
+
alternative uses its last attempted branch. Parallel execution retains a reason
|
|
178
|
+
only when exactly one branch failed. Selected then/else actions are covered;
|
|
179
|
+
internal context/condition evaluation and wait setup/cleanup may remain generic. An
|
|
180
|
+
unclassified fatal runtime fault must not reuse a prior handled action's reason.
|
|
181
|
+
Old generated Plans can remain generic until normal regeneration; no automatic
|
|
182
|
+
migration is required. The summary is independent of diagnostic-log retention.
|
|
171
183
|
|
|
172
184
|
Independent read failure and partial-result rules are defined in
|
|
173
185
|
[resource-read-failures-v1.md](resource-read-failures-v1.md).
|
|
@@ -71,11 +71,28 @@ second durable outbox, reasoning replay or write replay.
|
|
|
71
71
|
|
|
72
72
|
## Generic content and validation
|
|
73
73
|
|
|
74
|
-
`SuggestionDraft<C>` contains title, summary, reasons, evidence, optional
|
|
75
|
-
|
|
76
|
-
identity, Space, run, version, lifecycle,
|
|
77
|
-
The generator cannot assign those backend fields.
|
|
78
|
-
against admission/publication time before persistence.
|
|
74
|
+
`SuggestionDraft<C>` contains title, summary, reasons, evidence, optional `audience`
|
|
75
|
+
(defaulting to `{"kind":"space"}`), optional expiry, and flattened content selected
|
|
76
|
+
by `type`. `Suggestion<C>` adds backend-owned identity, Space, run, version, lifecycle,
|
|
77
|
+
millisecond timestamps and resolution. The generator cannot assign those backend fields.
|
|
78
|
+
A suggested expiry is checked against admission/publication time before persistence.
|
|
79
|
+
|
|
80
|
+
### Audience and visibility
|
|
81
|
+
|
|
82
|
+
Every Suggestion belongs to its Space and carries a `SuggestionAudience`:
|
|
83
|
+
|
|
84
|
+
- `{"kind":"space"}` (default and mainstream): visible to all authorized Space members
|
|
85
|
+
and enrolled shared Space principals (`ClientPrincipal::Space`, e.g. wall panels).
|
|
86
|
+
- `{"kind":"users","userIds":["..."]}` (rare): visible strictly to the listed Space
|
|
87
|
+
members (`userIds` must be nonblank and unique). Hidden from all other members and
|
|
88
|
+
from shared Space principals; non-audience calls to detail, handle, or feedback
|
|
89
|
+
return `NOT_FOUND` without disclosing existence.
|
|
90
|
+
|
|
91
|
+
Whenever `audience` is omitted in a draft or older record, it defaults to `{"kind":"space"}`.
|
|
92
|
+
Backends validate that every `userId` in a `users` audience is a real current member of the
|
|
93
|
+
Space before persisting a generated draft, and enforce that any recorded resolution actor is
|
|
94
|
+
authorized by the Suggestion's `audience`. `GenerateInput` does not accept an `audience` field;
|
|
95
|
+
explicit requests do not override audience modeling.
|
|
79
96
|
|
|
80
97
|
Type names use `UPPER_CASE`. A registered type declares its strict content model,
|
|
81
98
|
validator and supported business actions. The content must serialize to an
|