@mplp/sdk-ts 1.0.1 → 1.0.3

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 (70) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +29 -0
  3. package/dist/builders/confirm-builder.d.ts +4 -8
  4. package/dist/builders/confirm-builder.js +6 -10
  5. package/dist/builders/context-builder.d.ts +4 -8
  6. package/dist/builders/context-builder.js +6 -10
  7. package/dist/builders/plan-builder.d.ts +4 -8
  8. package/dist/builders/plan-builder.js +6 -10
  9. package/dist/builders/trace-builder.d.ts +4 -8
  10. package/dist/builders/trace-builder.js +6 -10
  11. package/dist/client/runtime-client.d.ts +4 -8
  12. package/dist/client/runtime-client.js +6 -10
  13. package/dist/coordination/index.d.ts +8 -0
  14. package/dist/coordination/index.js +11 -0
  15. package/dist/core/index.d.ts +28 -0
  16. package/dist/core/index.js +21 -0
  17. package/dist/core/validators/index.d.ts +12 -0
  18. package/dist/core/validators/index.js +22 -0
  19. package/dist/index.d.ts +4 -8
  20. package/dist/index.js +7 -11
  21. package/dist/runtime/index.d.ts +11 -0
  22. package/dist/runtime/index.js +14 -0
  23. package/dist/runtime-minimal/index.d.ts +52 -0
  24. package/dist/runtime-minimal/index.js +28 -0
  25. package/dist/types/index.d.ts +21 -0
  26. package/dist/types/index.js +2 -0
  27. package/package.json +55 -14
  28. package/schemas/common/common-types.schema.json +55 -0
  29. package/schemas/common/events.schema.json +72 -0
  30. package/schemas/common/identifiers.schema.json +19 -0
  31. package/schemas/common/learning-sample.schema.json +200 -0
  32. package/schemas/common/metadata.schema.json +119 -0
  33. package/schemas/common/trace-base.schema.json +49 -0
  34. package/schemas/events/mplp-event-core.schema.json +64 -0
  35. package/schemas/events/mplp-graph-update-event.schema.json +64 -0
  36. package/schemas/events/mplp-map-event.schema.json +153 -0
  37. package/schemas/events/mplp-pipeline-stage-event.schema.json +62 -0
  38. package/schemas/events/mplp-runtime-execution-event.schema.json +64 -0
  39. package/schemas/events/mplp-sa-event.schema.json +115 -0
  40. package/schemas/integration/mplp-ci-event.schema.json +136 -0
  41. package/schemas/integration/mplp-file-update-event.schema.json +76 -0
  42. package/schemas/integration/mplp-git-event.schema.json +104 -0
  43. package/schemas/integration/mplp-tool-event.schema.json +89 -0
  44. package/schemas/invariants/integration-invariants.yaml +147 -0
  45. package/schemas/invariants/learning-invariants.yaml +106 -0
  46. package/schemas/invariants/map-invariants.yaml +73 -0
  47. package/schemas/invariants/observability-invariants.yaml +106 -0
  48. package/schemas/invariants/sa-invariants.yaml +72 -0
  49. package/schemas/learning/mplp-learning-sample-core.schema.json +100 -0
  50. package/schemas/learning/mplp-learning-sample-delta.schema.json +143 -0
  51. package/schemas/learning/mplp-learning-sample-intent.schema.json +125 -0
  52. package/schemas/mplp-collab.schema.json +249 -0
  53. package/schemas/mplp-confirm.schema.json +232 -0
  54. package/schemas/mplp-context.schema.json +252 -0
  55. package/schemas/mplp-core.schema.json +189 -0
  56. package/schemas/mplp-dialog.schema.json +204 -0
  57. package/schemas/mplp-extension.schema.json +185 -0
  58. package/schemas/mplp-network.schema.json +236 -0
  59. package/schemas/mplp-plan.schema.json +199 -0
  60. package/schemas/mplp-role.schema.json +145 -0
  61. package/schemas/mplp-trace.schema.json +222 -0
  62. package/src/builders/confirm-builder.ts +0 -44
  63. package/src/builders/context-builder.ts +0 -56
  64. package/src/builders/plan-builder.ts +0 -56
  65. package/src/builders/trace-builder.ts +0 -55
  66. package/src/client/runtime-client.ts +0 -103
  67. package/src/index.ts +0 -18
  68. package/tests/builders.test.ts +0 -80
  69. package/tests/client-single-agent.test.ts +0 -48
  70. package/tsconfig.json +0 -23
@@ -0,0 +1,199 @@
1
+ {
2
+ "$comment": "MPLP v1.0.0 FROZEN – © 2025 邦士(北京)网络科技有限公司 – Apache-2.0 – Governance: MPGC",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$id": "https://schemas.mplp.dev/v1.0/mplp-plan.schema.json",
5
+ "title": "MPLP Plan Module – Core Protocol v1.0",
6
+ "description": "Plan Module Core Protocol: Describes the plan objects and their lifecycle minimal required semantics (Core Profile) in multi-agent collaboration.",
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "meta": {
11
+ "$ref": "common/metadata.schema.json",
12
+ "description": "[PROTOCOL-CORE] MPLP protocol schema metadata (version, source, cross-cutting tags, etc.)."
13
+ },
14
+ "plan_id": {
15
+ "$ref": "common/identifiers.schema.json",
16
+ "description": "[PROTOCOL-CORE] Global unique identifier for the Plan."
17
+ },
18
+ "context_id": {
19
+ "$ref": "common/identifiers.schema.json",
20
+ "description": "[PROTOCOL-CORE] Identifier of the Context this Plan belongs to."
21
+ },
22
+ "title": {
23
+ "type": "string",
24
+ "minLength": 1,
25
+ "description": "[PROTOCOL-CORE] Plan title (brief description for humans and Agents)."
26
+ },
27
+ "objective": {
28
+ "type": "string",
29
+ "minLength": 1,
30
+ "description": "[PROTOCOL-CORE] Description of the objective to be achieved by the Plan."
31
+ },
32
+ "status": {
33
+ "type": "string",
34
+ "description": "[PROTOCOL-CORE] Status of the Plan in its lifecycle.",
35
+ "enum": [
36
+ "draft",
37
+ "proposed",
38
+ "approved",
39
+ "in_progress",
40
+ "completed",
41
+ "cancelled",
42
+ "failed"
43
+ ]
44
+ },
45
+ "steps": {
46
+ "type": "array",
47
+ "description": "[PROTOCOL-CORE] List of core steps decomposed from the Plan.",
48
+ "minItems": 1,
49
+ "items": {
50
+ "$ref": "#/$defs/plan_step_core"
51
+ }
52
+ },
53
+ "trace": {
54
+ "$ref": "common/trace-base.schema.json",
55
+ "description": "[PROTOCOL-CORE] Main execution trace reference associated with this Plan."
56
+ },
57
+ "events": {
58
+ "type": "array",
59
+ "description": "[PROTOCOL-CORE] List of key events directly associated with this Plan (changes, approvals, status transitions, etc.).",
60
+ "items": {
61
+ "$ref": "common/events.schema.json"
62
+ }
63
+ }
64
+ },
65
+ "required": [
66
+ "meta",
67
+ "plan_id",
68
+ "context_id",
69
+ "title",
70
+ "objective",
71
+ "status",
72
+ "steps"
73
+ ],
74
+ "$defs": {
75
+ "plan_core_properties": {
76
+ "type": "object",
77
+ "properties": {
78
+ "meta": {
79
+ "$ref": "common/metadata.schema.json",
80
+ "description": "[PROTOCOL-CORE] MPLP protocol schema metadata (version, source, cross-cutting tags, etc.)."
81
+ },
82
+ "plan_id": {
83
+ "$ref": "common/identifiers.schema.json",
84
+ "description": "[PROTOCOL-CORE] Global unique identifier for the Plan."
85
+ },
86
+ "context_id": {
87
+ "$ref": "common/identifiers.schema.json",
88
+ "description": "[PROTOCOL-CORE] Identifier of the Context this Plan belongs to."
89
+ },
90
+ "title": {
91
+ "type": "string",
92
+ "minLength": 1,
93
+ "description": "[PROTOCOL-CORE] Plan title (brief description for humans and Agents)."
94
+ },
95
+ "objective": {
96
+ "type": "string",
97
+ "minLength": 1,
98
+ "description": "[PROTOCOL-CORE] Description of the objective to be achieved by the Plan."
99
+ },
100
+ "status": {
101
+ "type": "string",
102
+ "description": "[PROTOCOL-CORE] Status of the Plan in its lifecycle.",
103
+ "enum": [
104
+ "draft",
105
+ "proposed",
106
+ "approved",
107
+ "in_progress",
108
+ "completed",
109
+ "cancelled",
110
+ "failed"
111
+ ]
112
+ },
113
+ "steps": {
114
+ "type": "array",
115
+ "description": "[PROTOCOL-CORE] List of core steps decomposed from the Plan.",
116
+ "minItems": 1,
117
+ "items": {
118
+ "$ref": "#/$defs/plan_step_core"
119
+ }
120
+ },
121
+ "trace": {
122
+ "$ref": "common/trace-base.schema.json",
123
+ "description": "[PROTOCOL-CORE] Main execution trace reference associated with this Plan."
124
+ },
125
+ "events": {
126
+ "type": "array",
127
+ "description": "[PROTOCOL-CORE] List of key events directly associated with this Plan (changes, approvals, status transitions, etc.).",
128
+ "items": {
129
+ "$ref": "common/events.schema.json"
130
+ }
131
+ }
132
+ },
133
+ "required": [
134
+ "meta",
135
+ "plan_id",
136
+ "context_id",
137
+ "title",
138
+ "objective",
139
+ "status",
140
+ "steps"
141
+ ]
142
+ },
143
+ "plan_step_core": {
144
+ "type": "object",
145
+ "description": "[PROTOCOL-CORE] Minimal required semantics for a plan step (excluding execution engine, scheduling policy implementation details).",
146
+ "additionalProperties": false,
147
+ "properties": {
148
+ "step_id": {
149
+ "$ref": "common/identifiers.schema.json",
150
+ "description": "[PROTOCOL-CORE] Global unique identifier for the step."
151
+ },
152
+ "description": {
153
+ "type": "string",
154
+ "minLength": 1,
155
+ "description": "[PROTOCOL-CORE] Content of the work to be completed in the step."
156
+ },
157
+ "status": {
158
+ "type": "string",
159
+ "description": "[PROTOCOL-CORE] Current status of the step.",
160
+ "enum": [
161
+ "pending",
162
+ "in_progress",
163
+ "completed",
164
+ "blocked",
165
+ "skipped",
166
+ "failed"
167
+ ]
168
+ },
169
+ "dependencies": {
170
+ "type": "array",
171
+ "description": "[PROTOCOL-CORE] List of other step IDs that this step depends on.",
172
+ "items": {
173
+ "$ref": "common/identifiers.schema.json"
174
+ }
175
+ },
176
+ "agent_role": {
177
+ "type": "string",
178
+ "description": "[PROTOCOL-CORE] Identifier of the role responsible for this step (should correspond to role_id in Role module)."
179
+ },
180
+ "order_index": {
181
+ "type": "integer",
182
+ "minimum": 0,
183
+ "description": "[PROTOCOL-CORE] Sort index in the current Plan, used for defining execution order or display order."
184
+ }
185
+ },
186
+ "required": [
187
+ "step_id",
188
+ "description",
189
+ "status"
190
+ ]
191
+ }
192
+ },
193
+ "x-mplp-meta": {
194
+ "protocolVersion": "1.0.0",
195
+ "frozen": true,
196
+ "freezeDate": "2025-12-03",
197
+ "governance": "MPGC"
198
+ }
199
+ }
@@ -0,0 +1,145 @@
1
+ {
2
+ "$comment": "MPLP v1.0.0 FROZEN – © 2025 邦士(北京)网络科技有限公司 – Apache-2.0 – Governance: MPGC",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$id": "https://schemas.mplp.dev/v1.0/mplp-role.schema.json",
5
+ "title": "MPLP Role Module – Core Protocol v1.0",
6
+ "description": "Role Module Core Protocol: Describes the minimal required semantics (Core Profile) for capability declarations, permission declarations, and behavioral identity models in multi-agent systems.",
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "meta": {
11
+ "$ref": "common/metadata.schema.json",
12
+ "description": "[PROTOCOL-CORE] MPLP protocol schema metadata (version, source, cross-cutting tags, etc.)."
13
+ },
14
+ "governance": {
15
+ "type": "object",
16
+ "description": "[PROTOCOL-CORE] Governance metadata for lifecycle management, truth domain authority, and locking status.",
17
+ "properties": {
18
+ "lifecyclePhase": {
19
+ "type": "string",
20
+ "description": "Current phase in the lifecycle fence (e.g., 'design', 'implementation', 'review')."
21
+ },
22
+ "truthDomain": {
23
+ "type": "string",
24
+ "description": "The truth domain this object belongs to (e.g., 'requirements', 'architecture')."
25
+ },
26
+ "locked": {
27
+ "type": "boolean",
28
+ "description": "If true, this object cannot be modified except by specific governance overrides."
29
+ },
30
+ "lastConfirmRef": {
31
+ "$ref": "common/common-types.schema.json#/definitions/Ref",
32
+ "description": "Reference to the last Confirm decision that validated this state."
33
+ }
34
+ },
35
+ "additionalProperties": false
36
+ },
37
+ "role_id": {
38
+ "$ref": "common/identifiers.schema.json",
39
+ "description": "[PROTOCOL-CORE] Global unique identifier for the Role."
40
+ },
41
+ "name": {
42
+ "type": "string",
43
+ "description": "[PROTOCOL-CORE] Human-readable name of the role (e.g., 'planner', 'reviewer', 'executor')."
44
+ },
45
+ "description": {
46
+ "type": "string",
47
+ "description": "[PROTOCOL-CORE] Detailed description of the role function, for humans and Agents."
48
+ },
49
+ "capabilities": {
50
+ "type": "array",
51
+ "description": "[PROTOCOL-CORE] List of capability/permission tags possessed by the role (e.g., 'plan.create', 'confirm.approve').",
52
+ "items": {
53
+ "type": "string"
54
+ }
55
+ },
56
+ "created_at": {
57
+ "type": "string",
58
+ "format": "date-time",
59
+ "description": "[PROTOCOL-CORE] Role creation time (ISO 8601)."
60
+ },
61
+ "updated_at": {
62
+ "type": "string",
63
+ "format": "date-time",
64
+ "description": "[PROTOCOL-CORE] Role last update time (ISO 8601)."
65
+ },
66
+ "trace": {
67
+ "$ref": "common/trace-base.schema.json",
68
+ "description": "[PROTOCOL-CORE] Audit trace reference associated with this role."
69
+ },
70
+ "events": {
71
+ "type": "array",
72
+ "description": "[PROTOCOL-CORE] List of key events directly related to this role (creation, permission changes, deactivation, etc.).",
73
+ "items": {
74
+ "$ref": "common/events.schema.json"
75
+ }
76
+ }
77
+ },
78
+ "required": [
79
+ "meta",
80
+ "role_id",
81
+ "name"
82
+ ],
83
+ "$defs": {
84
+ "role_core_properties": {
85
+ "type": "object",
86
+ "properties": {
87
+ "meta": {
88
+ "$ref": "common/metadata.schema.json",
89
+ "description": "[PROTOCOL-CORE] MPLP protocol schema metadata (version, source, cross-cutting tags, etc.)."
90
+ },
91
+ "role_id": {
92
+ "$ref": "common/identifiers.schema.json",
93
+ "description": "[PROTOCOL-CORE] Global unique identifier for the Role."
94
+ },
95
+ "name": {
96
+ "type": "string",
97
+ "description": "[PROTOCOL-CORE] Human-readable name of the role (e.g., 'planner', 'reviewer', 'executor')."
98
+ },
99
+ "description": {
100
+ "type": "string",
101
+ "description": "[PROTOCOL-CORE] Detailed description of the role function, for humans and Agents."
102
+ },
103
+ "capabilities": {
104
+ "type": "array",
105
+ "description": "[PROTOCOL-CORE] List of capability/permission tags possessed by the role (e.g., 'plan.create', 'confirm.approve').",
106
+ "items": {
107
+ "type": "string"
108
+ }
109
+ },
110
+ "created_at": {
111
+ "type": "string",
112
+ "format": "date-time",
113
+ "description": "[PROTOCOL-CORE] Role creation time (ISO 8601)."
114
+ },
115
+ "updated_at": {
116
+ "type": "string",
117
+ "format": "date-time",
118
+ "description": "[PROTOCOL-CORE] Role last update time (ISO 8601)."
119
+ },
120
+ "trace": {
121
+ "$ref": "common/trace-base.schema.json",
122
+ "description": "[PROTOCOL-CORE] Audit trace reference associated with this role."
123
+ },
124
+ "events": {
125
+ "type": "array",
126
+ "description": "[PROTOCOL-CORE] List of key events directly related to this role (creation, permission changes, deactivation, etc.).",
127
+ "items": {
128
+ "$ref": "common/events.schema.json"
129
+ }
130
+ }
131
+ },
132
+ "required": [
133
+ "meta",
134
+ "role_id",
135
+ "name"
136
+ ]
137
+ }
138
+ },
139
+ "x-mplp-meta": {
140
+ "protocolVersion": "1.0.0",
141
+ "frozen": true,
142
+ "freezeDate": "2025-12-03",
143
+ "governance": "MPGC"
144
+ }
145
+ }
@@ -0,0 +1,222 @@
1
+ {
2
+ "$comment": "MPLP v1.0.0 FROZEN – © 2025 邦士(北京)网络科技有限公司 – Apache-2.0 – Governance: MPGC",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$id": "https://schemas.mplp.dev/v1.0/mplp-trace.schema.json",
5
+ "title": "MPLP Trace Module – Core Protocol v1.0",
6
+ "description": "Trace Module Core Protocol: Describes the minimal required semantics (Core Profile) for execution trace resources (Trace) and their key segments and events.",
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "meta": {
11
+ "$ref": "common/metadata.schema.json",
12
+ "description": "[PROTOCOL-CORE] MPLP protocol and schema metadata."
13
+ },
14
+ "governance": {
15
+ "type": "object",
16
+ "description": "[PROTOCOL-CORE] Governance metadata for lifecycle management, truth domain authority, and locking status.",
17
+ "properties": {
18
+ "lifecyclePhase": {
19
+ "type": "string",
20
+ "description": "Current phase in the lifecycle fence (e.g., 'design', 'implementation', 'review')."
21
+ },
22
+ "truthDomain": {
23
+ "type": "string",
24
+ "description": "The truth domain this object belongs to (e.g., 'requirements', 'architecture')."
25
+ },
26
+ "locked": {
27
+ "type": "boolean",
28
+ "description": "If true, this object cannot be modified except by specific governance overrides."
29
+ },
30
+ "lastConfirmRef": {
31
+ "$ref": "common/common-types.schema.json#/definitions/Ref",
32
+ "description": "Reference to the last Confirm decision that validated this state."
33
+ }
34
+ },
35
+ "additionalProperties": false
36
+ },
37
+ "trace_id": {
38
+ "$ref": "common/identifiers.schema.json",
39
+ "description": "[PROTOCOL-CORE] Global unique identifier for the Trace."
40
+ },
41
+ "context_id": {
42
+ "$ref": "common/identifiers.schema.json",
43
+ "description": "[PROTOCOL-CORE] Identifier of the Context this Trace belongs to."
44
+ },
45
+ "plan_id": {
46
+ "$ref": "common/identifiers.schema.json",
47
+ "description": "[PROTOCOL-CORE] Identifier of the Plan associated with this Trace (if any)."
48
+ },
49
+ "root_span": {
50
+ "$ref": "common/trace-base.schema.json",
51
+ "description": "[PROTOCOL-CORE] Root span definition of the Trace (follows L1 trace-base structure)."
52
+ },
53
+ "status": {
54
+ "type": "string",
55
+ "description": "[PROTOCOL-CORE] Current status of the Trace.",
56
+ "enum": [
57
+ "pending",
58
+ "running",
59
+ "completed",
60
+ "failed",
61
+ "cancelled"
62
+ ]
63
+ },
64
+ "started_at": {
65
+ "type": "string",
66
+ "format": "date-time",
67
+ "description": "[PROTOCOL-CORE] Trace start time (ISO 8601)."
68
+ },
69
+ "finished_at": {
70
+ "type": "string",
71
+ "format": "date-time",
72
+ "description": "[PROTOCOL-CORE] Trace finish time (ISO 8601, optional if not finished)."
73
+ },
74
+ "segments": {
75
+ "type": "array",
76
+ "description": "[PROTOCOL-CORE] Key execution segments in the Trace (can correspond to multiple spans or phased aggregations).",
77
+ "items": {
78
+ "$ref": "#/$defs/trace_segment_core"
79
+ }
80
+ },
81
+ "events": {
82
+ "type": "array",
83
+ "description": "[PROTOCOL-CORE] List of events directly related to this Trace (errors, retries, status changes, etc.).",
84
+ "items": {
85
+ "$ref": "common/events.schema.json"
86
+ }
87
+ }
88
+ },
89
+ "required": [
90
+ "meta",
91
+ "trace_id",
92
+ "context_id",
93
+ "root_span",
94
+ "status"
95
+ ],
96
+ "$defs": {
97
+ "trace_core_properties": {
98
+ "type": "object",
99
+ "properties": {
100
+ "meta": {
101
+ "$ref": "common/metadata.schema.json",
102
+ "description": "[PROTOCOL-CORE] MPLP protocol and schema metadata."
103
+ },
104
+ "trace_id": {
105
+ "$ref": "common/identifiers.schema.json",
106
+ "description": "[PROTOCOL-CORE] Global unique identifier for the Trace."
107
+ },
108
+ "context_id": {
109
+ "$ref": "common/identifiers.schema.json",
110
+ "description": "[PROTOCOL-CORE] Identifier of the Context this Trace belongs to."
111
+ },
112
+ "plan_id": {
113
+ "$ref": "common/identifiers.schema.json",
114
+ "description": "[PROTOCOL-CORE] Identifier of the Plan associated with this Trace (if any)."
115
+ },
116
+ "root_span": {
117
+ "$ref": "common/trace-base.schema.json",
118
+ "description": "[PROTOCOL-CORE] Root span definition of the Trace (follows L1 trace-base structure)."
119
+ },
120
+ "status": {
121
+ "type": "string",
122
+ "description": "[PROTOCOL-CORE] Current status of the Trace.",
123
+ "enum": [
124
+ "pending",
125
+ "running",
126
+ "completed",
127
+ "failed",
128
+ "cancelled"
129
+ ]
130
+ },
131
+ "started_at": {
132
+ "type": "string",
133
+ "format": "date-time",
134
+ "description": "[PROTOCOL-CORE] Trace start time (ISO 8601)."
135
+ },
136
+ "finished_at": {
137
+ "type": "string",
138
+ "format": "date-time",
139
+ "description": "[PROTOCOL-CORE] Trace finish time (ISO 8601, optional if not finished)."
140
+ },
141
+ "segments": {
142
+ "type": "array",
143
+ "description": "[PROTOCOL-CORE] Key execution segments in the Trace (can correspond to multiple spans or phased aggregations).",
144
+ "items": {
145
+ "$ref": "#/$defs/trace_segment_core"
146
+ }
147
+ },
148
+ "events": {
149
+ "type": "array",
150
+ "description": "[PROTOCOL-CORE] List of events directly related to this Trace (errors, retries, status changes, etc.).",
151
+ "items": {
152
+ "$ref": "common/events.schema.json"
153
+ }
154
+ }
155
+ },
156
+ "required": [
157
+ "meta",
158
+ "trace_id",
159
+ "context_id",
160
+ "root_span",
161
+ "status"
162
+ ]
163
+ },
164
+ "trace_segment_core": {
165
+ "type": "object",
166
+ "description": "[PROTOCOL-CORE] Key segments in execution tracing, used to express an auditable execution interval at the protocol layer.",
167
+ "additionalProperties": false,
168
+ "properties": {
169
+ "segment_id": {
170
+ "$ref": "common/identifiers.schema.json",
171
+ "description": "[PROTOCOL-CORE] Segment identifier."
172
+ },
173
+ "parent_segment_id": {
174
+ "$ref": "common/identifiers.schema.json",
175
+ "description": "[PROTOCOL-CORE] Parent segment identifier (optional if root segment)."
176
+ },
177
+ "label": {
178
+ "type": "string",
179
+ "description": "[PROTOCOL-CORE] Segment label/name, for human and Agent identification of the interval."
180
+ },
181
+ "status": {
182
+ "type": "string",
183
+ "description": "[PROTOCOL-CORE] Segment status.",
184
+ "enum": [
185
+ "pending",
186
+ "running",
187
+ "completed",
188
+ "failed",
189
+ "cancelled",
190
+ "skipped"
191
+ ]
192
+ },
193
+ "started_at": {
194
+ "type": "string",
195
+ "format": "date-time",
196
+ "description": "[PROTOCOL-CORE] Segment start time."
197
+ },
198
+ "finished_at": {
199
+ "type": "string",
200
+ "format": "date-time",
201
+ "description": "[PROTOCOL-CORE] Segment finish time (optional if not finished)."
202
+ },
203
+ "attributes": {
204
+ "type": "object",
205
+ "description": "[PROTOCOL-CORE] Key context attributes related to this segment (key-value form, for tracing and audit).",
206
+ "additionalProperties": true
207
+ }
208
+ },
209
+ "required": [
210
+ "segment_id",
211
+ "label",
212
+ "status"
213
+ ]
214
+ }
215
+ },
216
+ "x-mplp-meta": {
217
+ "protocolVersion": "1.0.0",
218
+ "frozen": true,
219
+ "freezeDate": "2025-12-03",
220
+ "governance": "MPGC"
221
+ }
222
+ }
@@ -1,44 +0,0 @@
1
- /**
2
- * MPLP Protocol v1.0.0 — Frozen Specification
3
- * Freeze Date: 2025-12-03
4
- * Status: FROZEN (no breaking changes permitted)
5
- * Governance: MPLP Protocol Governance Committee (MPGC)
6
- *
7
- * © 2025 邦士(北京)网络科技有限公司. All rights reserved.
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- */
12
-
13
- import { Confirm, Plan, validateConfirm } from "@mplp/core";
14
- import { v4 as uuidv4 } from "uuid";
15
-
16
- export interface CreateConfirmOptions {
17
- status: "approved" | "rejected" | "pending" | "cancelled";
18
- requestedByRole?: string;
19
- reason?: string;
20
- }
21
-
22
- export function createConfirm(plan: Plan, options: CreateConfirmOptions): Confirm {
23
- const confirm: Confirm = {
24
- meta: {
25
- protocol_version: "1.0.0",
26
- schema_version: "1.0.0",
27
- created_at: new Date().toISOString()
28
- },
29
- confirm_id: uuidv4(),
30
- target_type: "plan",
31
- target_id: plan.plan_id,
32
- status: options.status,
33
- requested_by_role: options.requestedByRole || "system",
34
- requested_at: new Date().toISOString(),
35
- ...(options.reason && { reason: options.reason })
36
- };
37
-
38
- const validation = validateConfirm(confirm);
39
- if (!validation.ok) {
40
- throw new Error(`Invalid Confirm generated: ${JSON.stringify(validation.errors)}`);
41
- }
42
-
43
- return confirm;
44
- }
@@ -1,56 +0,0 @@
1
- /**
2
- * MPLP Protocol v1.0.0 — Frozen Specification
3
- * Freeze Date: 2025-12-03
4
- * Status: FROZEN (no breaking changes permitted)
5
- * Governance: MPLP Protocol Governance Committee (MPGC)
6
- *
7
- * © 2025 邦士(北京)网络科技有限公司. All rights reserved.
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- */
12
-
13
- import { Context, validateContext } from "@mplp/core";
14
- import { v4 as uuidv4 } from "uuid";
15
-
16
- export interface CreateContextOptions {
17
- title: string;
18
- root: {
19
- domain: string;
20
- environment: string;
21
- entry_point?: string;
22
- };
23
- summary?: string;
24
- tags?: string[];
25
- language?: string;
26
- owner_role?: string;
27
- constraints?: Record<string, any>;
28
- metadata?: Record<string, any>;
29
- }
30
-
31
- export function createContext(options: CreateContextOptions): Context {
32
- const context: Context = {
33
- meta: {
34
- protocol_version: "1.0.0",
35
- schema_version: "1.0.0",
36
- created_at: new Date().toISOString()
37
- },
38
- context_id: uuidv4(),
39
- root: options.root,
40
- title: options.title,
41
- status: "active",
42
- ...(options.summary && { summary: options.summary }),
43
- ...(options.tags && { tags: options.tags }),
44
- ...(options.language && { language: options.language }),
45
- ...(options.owner_role && { owner_role: options.owner_role }),
46
- ...(options.constraints && { constraints: options.constraints }),
47
- ...options.metadata
48
- };
49
-
50
- const validation = validateContext(context);
51
- if (!validation.ok) {
52
- throw new Error(`Invalid Context generated: ${JSON.stringify(validation.errors)}`);
53
- }
54
-
55
- return context;
56
- }