@mhome/conversation-protocol 3.0.4 → 3.1.1

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/README.md CHANGED
@@ -30,6 +30,11 @@ Model data is re-exported from `llm-api`; there is one model-message representat
30
30
  messages intentionally use separate content types and never contain private model continuation.
31
31
  Runtime state machines, checkpoint formats, prompts and recovery policy remain in Agent Runtime.
32
32
 
33
+ `RunErrorCode` is the closed catalog for `runOutcome.errorCode` and Agent `Failed.code`. Host
34
+ terminalize and Agent failures emit the same strings. `status` and `failure.source` are properties
35
+ of the code; `failure.code` equals `errorCode`. User-visible copy stays in `runOutcome.message`,
36
+ not in this crate. Command `/chat/*` errors and adapter `ExternalErrorKind` are separate layers.
37
+
33
38
  ## Cloud admission model snapshot
34
39
 
35
40
  Every cloud `LlmRoute` carries a required `model_snapshot` containing confirmed capabilities
@@ -41,3 +46,7 @@ snapshot. Version 3 stores `capabilities.input` as `image|video|audio|file` inst
41
46
  `vision: bool`. An old plan without the snapshot, or with `vision`, fails decoding instead
42
47
  of silently changing behavior. This development contract change must be published and
43
48
  adopted by Lion and Cloud together before deployment.
49
+
50
+ ### Strict execution envelope decoding
51
+
52
+ Execution commands, events, facade responses and their typed nested objects reject undeclared fields, including null-valued unknown fields. Opaque JSON inputs/results and model continuation payloads remain extensible; known optional null fields remain accepted. Enforcement lives on the typed DTOs as well as the wire entry point because Serde's internally tagged enum buffering bypasses an outer `serde_ignored` observer. Tagged unit variants explicitly require an empty remaining map. This restores the existing wire-v1 contract without changing its message shape or major version.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.conversation.targets.v1",
3
- "contractVersion": "3.0.4",
3
+ "contractVersion": "3.1.1",
4
4
  "requestTargets": [
5
5
  "/chat/thread/list",
6
6
  "/chat/thread/create",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhome/conversation-protocol",
3
- "version": "3.0.4",
3
+ "version": "3.1.1",
4
4
  "description": "Build-time protocol artifacts for mhome.conversation",
5
5
  "license": "MIT",
6
6
  "repository": {
package/protocol.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "protocol": "mhome.conversation",
3
- "contractVersion": "3.0.4",
3
+ "contractVersion": "3.1.1",
4
4
  "manifest": "manifest/targets.v1.json",
5
5
  "schemas": {
6
6
  "frame": "schema/conversation-frame.v2.schema.json",
@@ -8,6 +8,43 @@
8
8
  "type": "string",
9
9
  "minLength": 1
10
10
  },
11
+ "runErrorCode": {
12
+ "type": "string",
13
+ "enum": [
14
+ "CANCELLED",
15
+ "RUN_INTERRUPTED",
16
+ "EXECUTOR_TERMINATED",
17
+ "THREAD_EXPIRED",
18
+ "THREAD_ARCHIVED",
19
+ "AGENT_ADMISSION_TIMEOUT",
20
+ "AGENT_DEADLINE_EXCEEDED",
21
+ "AGENT_CONNECTION_LOST",
22
+ "AGENT_UNAVAILABLE",
23
+ "PROCESS_INTERRUPTED",
24
+ "PROTOCOL",
25
+ "INVALID_ENVELOPE",
26
+ "INVALID_FRAME",
27
+ "INVALID_JSON",
28
+ "STALE_DISPATCH",
29
+ "STALE_SESSION",
30
+ "UNSUPPORTED_VERSION",
31
+ "INVALID_FAMILY",
32
+ "INVALID_REQUEST",
33
+ "UNAUTHORIZED",
34
+ "UNAVAILABLE",
35
+ "RATE_LIMITED",
36
+ "CONTEXT_LIMIT",
37
+ "TIMEOUT",
38
+ "INTERNAL",
39
+ "OUTPUT_TRUNCATED",
40
+ "CREDIT_BUDGET_EXCEEDED",
41
+ "THREAD_BUSY",
42
+ "ADMISSION_REJECTED",
43
+ "AGENT_EXECUTION_FAILED",
44
+ "INVALID_MODEL_FINISH",
45
+ "INVALID_MODEL_TOOL_CALLS"
46
+ ]
47
+ },
11
48
  "surfaceId": {
12
49
  "type": "string",
13
50
  "pattern": "^cs1:(?:(?:cp|cg):[A-Za-z0-9_-]+|n:[a-z][a-z0-9_]*:[A-Za-z0-9_-]+:[A-Za-z0-9_-]+:[A-Za-z0-9_-]+|(?:mp|mg):[a-z][a-z0-9_]*:[A-Za-z0-9_-]+:[A-Za-z0-9_-]+(?::[A-Za-z0-9_-]+)?)$"
@@ -641,7 +678,7 @@
641
678
  ]
642
679
  },
643
680
  "code": {
644
- "$ref": "#/$defs/id"
681
+ "$ref": "#/$defs/runErrorCode"
645
682
  },
646
683
  "message": {
647
684
  "type": "string"
@@ -671,7 +708,7 @@
671
708
  "errorCode": {
672
709
  "oneOf": [
673
710
  {
674
- "type": "string"
711
+ "$ref": "#/$defs/runErrorCode"
675
712
  },
676
713
  {
677
714
  "type": "null"
@@ -8,6 +8,43 @@
8
8
  "type": "string",
9
9
  "minLength": 1
10
10
  },
11
+ "run_error_code": {
12
+ "type": "string",
13
+ "enum": [
14
+ "CANCELLED",
15
+ "RUN_INTERRUPTED",
16
+ "EXECUTOR_TERMINATED",
17
+ "THREAD_EXPIRED",
18
+ "THREAD_ARCHIVED",
19
+ "AGENT_ADMISSION_TIMEOUT",
20
+ "AGENT_DEADLINE_EXCEEDED",
21
+ "AGENT_CONNECTION_LOST",
22
+ "AGENT_UNAVAILABLE",
23
+ "PROCESS_INTERRUPTED",
24
+ "PROTOCOL",
25
+ "INVALID_ENVELOPE",
26
+ "INVALID_FRAME",
27
+ "INVALID_JSON",
28
+ "STALE_DISPATCH",
29
+ "STALE_SESSION",
30
+ "UNSUPPORTED_VERSION",
31
+ "INVALID_FAMILY",
32
+ "INVALID_REQUEST",
33
+ "UNAUTHORIZED",
34
+ "UNAVAILABLE",
35
+ "RATE_LIMITED",
36
+ "CONTEXT_LIMIT",
37
+ "TIMEOUT",
38
+ "INTERNAL",
39
+ "OUTPUT_TRUNCATED",
40
+ "CREDIT_BUDGET_EXCEEDED",
41
+ "THREAD_BUSY",
42
+ "ADMISSION_REJECTED",
43
+ "AGENT_EXECUTION_FAILED",
44
+ "INVALID_MODEL_FINISH",
45
+ "INVALID_MODEL_TOOL_CALLS"
46
+ ]
47
+ },
11
48
  "conversation_surface": {
12
49
  "type": "string",
13
50
  "pattern": "^cs1:(?:(?:cp|cg):[A-Za-z0-9_-]+|(?:mp|mg):[a-z0-9_]+:[A-Za-z0-9_-]+:[A-Za-z0-9_-]+(?::[A-Za-z0-9_-]+)?)$"
@@ -1043,7 +1080,7 @@
1043
1080
  "const": "failed"
1044
1081
  },
1045
1082
  "code": {
1046
- "$ref": "#/$defs/identifier"
1083
+ "$ref": "#/$defs/run_error_code"
1047
1084
  },
1048
1085
  "message": {
1049
1086
  "type": "string"