@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.
- package/CHANGELOG.md +15 -0
- package/README.md +29 -0
- package/dist/builders/confirm-builder.d.ts +4 -8
- package/dist/builders/confirm-builder.js +6 -10
- package/dist/builders/context-builder.d.ts +4 -8
- package/dist/builders/context-builder.js +6 -10
- package/dist/builders/plan-builder.d.ts +4 -8
- package/dist/builders/plan-builder.js +6 -10
- package/dist/builders/trace-builder.d.ts +4 -8
- package/dist/builders/trace-builder.js +6 -10
- package/dist/client/runtime-client.d.ts +4 -8
- package/dist/client/runtime-client.js +6 -10
- package/dist/coordination/index.d.ts +8 -0
- package/dist/coordination/index.js +11 -0
- package/dist/core/index.d.ts +28 -0
- package/dist/core/index.js +21 -0
- package/dist/core/validators/index.d.ts +12 -0
- package/dist/core/validators/index.js +22 -0
- package/dist/index.d.ts +4 -8
- package/dist/index.js +7 -11
- package/dist/runtime/index.d.ts +11 -0
- package/dist/runtime/index.js +14 -0
- package/dist/runtime-minimal/index.d.ts +52 -0
- package/dist/runtime-minimal/index.js +28 -0
- package/dist/types/index.d.ts +21 -0
- package/dist/types/index.js +2 -0
- package/package.json +55 -14
- package/schemas/common/common-types.schema.json +55 -0
- package/schemas/common/events.schema.json +72 -0
- package/schemas/common/identifiers.schema.json +19 -0
- package/schemas/common/learning-sample.schema.json +200 -0
- package/schemas/common/metadata.schema.json +119 -0
- package/schemas/common/trace-base.schema.json +49 -0
- package/schemas/events/mplp-event-core.schema.json +64 -0
- package/schemas/events/mplp-graph-update-event.schema.json +64 -0
- package/schemas/events/mplp-map-event.schema.json +153 -0
- package/schemas/events/mplp-pipeline-stage-event.schema.json +62 -0
- package/schemas/events/mplp-runtime-execution-event.schema.json +64 -0
- package/schemas/events/mplp-sa-event.schema.json +115 -0
- package/schemas/integration/mplp-ci-event.schema.json +136 -0
- package/schemas/integration/mplp-file-update-event.schema.json +76 -0
- package/schemas/integration/mplp-git-event.schema.json +104 -0
- package/schemas/integration/mplp-tool-event.schema.json +89 -0
- package/schemas/invariants/integration-invariants.yaml +147 -0
- package/schemas/invariants/learning-invariants.yaml +106 -0
- package/schemas/invariants/map-invariants.yaml +73 -0
- package/schemas/invariants/observability-invariants.yaml +106 -0
- package/schemas/invariants/sa-invariants.yaml +72 -0
- package/schemas/learning/mplp-learning-sample-core.schema.json +100 -0
- package/schemas/learning/mplp-learning-sample-delta.schema.json +143 -0
- package/schemas/learning/mplp-learning-sample-intent.schema.json +125 -0
- package/schemas/mplp-collab.schema.json +249 -0
- package/schemas/mplp-confirm.schema.json +232 -0
- package/schemas/mplp-context.schema.json +252 -0
- package/schemas/mplp-core.schema.json +189 -0
- package/schemas/mplp-dialog.schema.json +204 -0
- package/schemas/mplp-extension.schema.json +185 -0
- package/schemas/mplp-network.schema.json +236 -0
- package/schemas/mplp-plan.schema.json +199 -0
- package/schemas/mplp-role.schema.json +145 -0
- package/schemas/mplp-trace.schema.json +222 -0
- package/src/builders/confirm-builder.ts +0 -44
- package/src/builders/context-builder.ts +0 -56
- package/src/builders/plan-builder.ts +0 -56
- package/src/builders/trace-builder.ts +0 -55
- package/src/client/runtime-client.ts +0 -103
- package/src/index.ts +0 -18
- package/tests/builders.test.ts +0 -80
- package/tests/client-single-agent.test.ts +0 -48
- package/tsconfig.json +0 -23
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "MPLP v1.0.0 FROZEN – © 2025 邦士(北京)网络科技有限公司 – Apache-2.0 – Governance: MPGC",
|
|
3
|
+
"$id": "https://schemas.mplp.dev/v1.0/common/common-types.schema.json",
|
|
4
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
+
"title": "MPLP Common Types",
|
|
6
|
+
"description": "Common type definitions used across MPLP modules to ensure consistency and reduce duplication.",
|
|
7
|
+
"definitions": {
|
|
8
|
+
"MplpId": {
|
|
9
|
+
"$ref": "identifiers.schema.json"
|
|
10
|
+
},
|
|
11
|
+
"Ref": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"description": "A standard reference to another MPLP object.",
|
|
14
|
+
"properties": {
|
|
15
|
+
"id": {
|
|
16
|
+
"$ref": "#/definitions/MplpId"
|
|
17
|
+
},
|
|
18
|
+
"module": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": [
|
|
21
|
+
"context",
|
|
22
|
+
"plan",
|
|
23
|
+
"confirm",
|
|
24
|
+
"trace",
|
|
25
|
+
"role",
|
|
26
|
+
"extension",
|
|
27
|
+
"dialog",
|
|
28
|
+
"collab",
|
|
29
|
+
"core",
|
|
30
|
+
"network"
|
|
31
|
+
],
|
|
32
|
+
"description": "The module name of the referenced object."
|
|
33
|
+
},
|
|
34
|
+
"description": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Optional description of the reference relationship."
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"required": [
|
|
40
|
+
"id",
|
|
41
|
+
"module"
|
|
42
|
+
],
|
|
43
|
+
"additionalProperties": false
|
|
44
|
+
},
|
|
45
|
+
"BaseMeta": {
|
|
46
|
+
"$ref": "metadata.schema.json"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"x-mplp-meta": {
|
|
50
|
+
"protocolVersion": "1.0.0",
|
|
51
|
+
"frozen": true,
|
|
52
|
+
"freezeDate": "2025-12-03",
|
|
53
|
+
"governance": "MPGC"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "MPLP v1.0.0 FROZEN – © 2025 邦士(北京)网络科技有限公司 – Apache-2.0 – Governance: MPGC",
|
|
3
|
+
"$id": "https://schemas.mplp.dev/v1.0/common/events.schema.json",
|
|
4
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
+
"title": "MPLP Base Event",
|
|
6
|
+
"description": "Base model for all event structures in MPLP. Designed based on CloudEvents v1.0 core fields, providing unified event identification, type, source, and timestamp. ExecutionEvent, StateTransitionEvent, etc., are extensions of this.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"event_id": {
|
|
10
|
+
"$ref": "identifiers.schema.json",
|
|
11
|
+
"description": "Unique identifier for the event (UUID v4)."
|
|
12
|
+
},
|
|
13
|
+
"event_type": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Event type identifier, e.g., execution.started / vsl.transition.applied / plan.created. Uses dot-separated namespace format.",
|
|
16
|
+
"pattern": "^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9]*)*$",
|
|
17
|
+
"examples": [
|
|
18
|
+
"execution.started",
|
|
19
|
+
"execution.completed",
|
|
20
|
+
"vsl.transition.applied",
|
|
21
|
+
"plan.created"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"source": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Event source, typically a module or component identifier. Can be a module name (e.g., 'context') or component path (e.g., 'runtime.ael').",
|
|
27
|
+
"examples": [
|
|
28
|
+
"context",
|
|
29
|
+
"plan",
|
|
30
|
+
"runtime.ael",
|
|
31
|
+
"runtime.vsl"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"timestamp": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"format": "date-time",
|
|
37
|
+
"description": "Event occurrence time (ISO 8601 format).",
|
|
38
|
+
"examples": [
|
|
39
|
+
"2025-01-28T15:30:00.000Z"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"trace_id": {
|
|
43
|
+
"description": "Optional trace ID to associate the event with a specific Trace.",
|
|
44
|
+
"$ref": "identifiers.schema.json"
|
|
45
|
+
},
|
|
46
|
+
"data": {
|
|
47
|
+
"anyOf": [
|
|
48
|
+
{
|
|
49
|
+
"type": "object",
|
|
50
|
+
"description": "Business data related to the event, constrained by upper-layer structures. Can be any JSON object or null."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "null",
|
|
54
|
+
"description": "Business data related to the event, constrained by upper-layer structures. Can be any JSON object or null."
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"required": [
|
|
60
|
+
"event_id",
|
|
61
|
+
"event_type",
|
|
62
|
+
"source",
|
|
63
|
+
"timestamp"
|
|
64
|
+
],
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"x-mplp-meta": {
|
|
67
|
+
"protocolVersion": "1.0.0",
|
|
68
|
+
"frozen": true,
|
|
69
|
+
"freezeDate": "2025-12-03",
|
|
70
|
+
"governance": "MPGC"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "MPLP v1.0.0 FROZEN – © 2025 邦士(北京)网络科技有限公司 – Apache-2.0 – Governance: MPGC",
|
|
3
|
+
"$id": "https://schemas.mplp.dev/v1.0/common/identifiers.schema.json",
|
|
4
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
+
"title": "MPLP Identifier",
|
|
6
|
+
"description": "Unified identifier type used for contextId/planId/traceId/eventId, etc. Uses UUID v4 standard to ensure global uniqueness and collision-free generation in distributed environments.",
|
|
7
|
+
"type": "string",
|
|
8
|
+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
|
|
9
|
+
"examples": [
|
|
10
|
+
"123e4567-e89b-12d3-a456-426614174000",
|
|
11
|
+
"550e8400-e29b-41d4-a716-446655440000"
|
|
12
|
+
],
|
|
13
|
+
"x-mplp-meta": {
|
|
14
|
+
"protocolVersion": "1.0.0",
|
|
15
|
+
"frozen": true,
|
|
16
|
+
"freezeDate": "2025-12-03",
|
|
17
|
+
"governance": "MPGC"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
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/common/learning-sample.schema.json",
|
|
5
|
+
"title": "MPLP Learning Sample – Schema v2.0",
|
|
6
|
+
"description": "Structured learning sample for MPLP v1.0 runtimes.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"sample_id": {
|
|
11
|
+
"$ref": "identifiers.schema.json",
|
|
12
|
+
"description": "Unique identifier for this learning sample."
|
|
13
|
+
},
|
|
14
|
+
"project_id": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Project identifier this sample belongs to."
|
|
17
|
+
},
|
|
18
|
+
"intent_before": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"description": "Structured representation of the original intent (can reference Context/Plan).",
|
|
21
|
+
"additionalProperties": true
|
|
22
|
+
},
|
|
23
|
+
"plan": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"description": "Structured representation of the plan used (can reference Plan module).",
|
|
26
|
+
"additionalProperties": true
|
|
27
|
+
},
|
|
28
|
+
"delta_intents": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"description": "Array of delta intents proposed/applied.",
|
|
31
|
+
"items": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"graph_before": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"description": "Optional snapshot or summary of the knowledge graph before the change.",
|
|
39
|
+
"additionalProperties": true
|
|
40
|
+
},
|
|
41
|
+
"graph_after": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"description": "Optional snapshot or summary of the knowledge graph after the change.",
|
|
44
|
+
"additionalProperties": true
|
|
45
|
+
},
|
|
46
|
+
"pipeline_path": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"description": "Sequence of pipeline stages traversed.",
|
|
49
|
+
"items": {
|
|
50
|
+
"type": "string"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"success_flag": {
|
|
54
|
+
"type": "boolean",
|
|
55
|
+
"description": "Whether the action/intent succeeded."
|
|
56
|
+
},
|
|
57
|
+
"error_info": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"description": "Error details if action failed.",
|
|
60
|
+
"additionalProperties": false,
|
|
61
|
+
"properties": {
|
|
62
|
+
"error_code": {
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
"error_message": {
|
|
66
|
+
"type": "string"
|
|
67
|
+
},
|
|
68
|
+
"stack_trace": {
|
|
69
|
+
"type": "string"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"token_usage": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"description": "LLM token consumption metrics.",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"properties": {
|
|
78
|
+
"total_tokens": {
|
|
79
|
+
"type": "number",
|
|
80
|
+
"minimum": 0
|
|
81
|
+
},
|
|
82
|
+
"prompt_tokens": {
|
|
83
|
+
"type": "number",
|
|
84
|
+
"minimum": 0
|
|
85
|
+
},
|
|
86
|
+
"completion_tokens": {
|
|
87
|
+
"type": "number",
|
|
88
|
+
"minimum": 0
|
|
89
|
+
},
|
|
90
|
+
"by_agent": {
|
|
91
|
+
"type": "array",
|
|
92
|
+
"description": "Token usage breakdown by agent.",
|
|
93
|
+
"items": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"additionalProperties": false,
|
|
96
|
+
"properties": {
|
|
97
|
+
"agent_id": {
|
|
98
|
+
"type": "string"
|
|
99
|
+
},
|
|
100
|
+
"role": {
|
|
101
|
+
"type": "string"
|
|
102
|
+
},
|
|
103
|
+
"tokens": {
|
|
104
|
+
"type": "number",
|
|
105
|
+
"minimum": 0
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"required": [
|
|
109
|
+
"agent_id",
|
|
110
|
+
"tokens"
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"execution_time_ms": {
|
|
117
|
+
"type": "number",
|
|
118
|
+
"description": "Execution time in milliseconds.",
|
|
119
|
+
"minimum": 0
|
|
120
|
+
},
|
|
121
|
+
"impact_score": {
|
|
122
|
+
"type": "number",
|
|
123
|
+
"description": "Impact score (0.0-1.0).",
|
|
124
|
+
"minimum": 0,
|
|
125
|
+
"maximum": 1
|
|
126
|
+
},
|
|
127
|
+
"user_feedback": {
|
|
128
|
+
"type": "object",
|
|
129
|
+
"description": "Human feedback on the action/result.",
|
|
130
|
+
"additionalProperties": false,
|
|
131
|
+
"properties": {
|
|
132
|
+
"decision": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"enum": [
|
|
135
|
+
"approve",
|
|
136
|
+
"reject",
|
|
137
|
+
"override",
|
|
138
|
+
"unknown"
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
"comment": {
|
|
142
|
+
"type": "string"
|
|
143
|
+
},
|
|
144
|
+
"rating": {
|
|
145
|
+
"type": "number",
|
|
146
|
+
"minimum": 0,
|
|
147
|
+
"maximum": 5
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"governance_decisions": {
|
|
152
|
+
"type": "array",
|
|
153
|
+
"description": "Governance rules evaluated during execution.",
|
|
154
|
+
"items": {
|
|
155
|
+
"type": "object",
|
|
156
|
+
"additionalProperties": true
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"timestamps": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"description": "Execution timeline.",
|
|
162
|
+
"additionalProperties": false,
|
|
163
|
+
"properties": {
|
|
164
|
+
"started_at": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"format": "date-time"
|
|
167
|
+
},
|
|
168
|
+
"completed_at": {
|
|
169
|
+
"type": "string",
|
|
170
|
+
"format": "date-time"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"required": [
|
|
174
|
+
"started_at"
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
"metadata": {
|
|
178
|
+
"type": "object",
|
|
179
|
+
"description": "Additional metadata (extensibility point).",
|
|
180
|
+
"additionalProperties": true
|
|
181
|
+
},
|
|
182
|
+
"vendor_extensions": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"description": "Optional vendor-specific extensions. Structure is implementation-defined and MUST NOT conflict with core protocol fields.",
|
|
185
|
+
"additionalProperties": true
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"required": [
|
|
189
|
+
"sample_id",
|
|
190
|
+
"project_id",
|
|
191
|
+
"success_flag",
|
|
192
|
+
"timestamps"
|
|
193
|
+
],
|
|
194
|
+
"x-mplp-meta": {
|
|
195
|
+
"protocolVersion": "1.0.0",
|
|
196
|
+
"frozen": true,
|
|
197
|
+
"freezeDate": "2025-12-03",
|
|
198
|
+
"governance": "MPGC"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "MPLP v1.0.0 FROZEN – © 2025 邦士(北京)网络科技有限公司 – Apache-2.0 – Governance: MPGC",
|
|
3
|
+
"$id": "https://schemas.mplp.dev/v1.0/common/metadata.schema.json",
|
|
4
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
+
"title": "MPLP Metadata",
|
|
6
|
+
"description": "Common metadata structure for all MPLP objects. Provides version control, creation info, tags, and cross-cutting concern declarations. All top-level objects in L2/L3/L4 should include the meta field.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"protocol_version": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
|
|
12
|
+
"description": "MPLP protocol version, using Semantic Versioning.",
|
|
13
|
+
"examples": [
|
|
14
|
+
"1.0.0",
|
|
15
|
+
"1.1.0"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"schema_version": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
|
|
21
|
+
"description": "Schema version used by the current object, using Semantic Versioning.",
|
|
22
|
+
"examples": [
|
|
23
|
+
"2.0.0",
|
|
24
|
+
"2.1.0"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"created_at": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"format": "date-time",
|
|
30
|
+
"description": "Object creation time (ISO 8601 format).",
|
|
31
|
+
"examples": [
|
|
32
|
+
"2025-01-28T15:30:00.000Z"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"created_by": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "Creator identifier (User ID / Agent Name / System ID).",
|
|
38
|
+
"examples": [
|
|
39
|
+
"user-123",
|
|
40
|
+
"agent-planner",
|
|
41
|
+
"system"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"updated_at": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"format": "date-time",
|
|
47
|
+
"description": "Object last update time (ISO 8601 format).",
|
|
48
|
+
"examples": [
|
|
49
|
+
"2025-01-28T16:45:00.000Z"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"updated_by": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "Last updater identifier.",
|
|
55
|
+
"examples": [
|
|
56
|
+
"user-456",
|
|
57
|
+
"agent-executor"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"tags": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"items": {
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
"description": "Set of tags for indexing/search. Supports custom classification and retrieval.",
|
|
66
|
+
"uniqueItems": true,
|
|
67
|
+
"examples": [
|
|
68
|
+
[
|
|
69
|
+
"production",
|
|
70
|
+
"high-priority"
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
"development",
|
|
74
|
+
"experimental"
|
|
75
|
+
]
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"cross_cutting": {
|
|
79
|
+
"type": "array",
|
|
80
|
+
"description": "Declares cross-cutting concerns enabled for the current object (one of the 9 concerns in Governance Plane).",
|
|
81
|
+
"items": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"enum": [
|
|
84
|
+
"coordination",
|
|
85
|
+
"error-handling",
|
|
86
|
+
"event-bus",
|
|
87
|
+
"orchestration",
|
|
88
|
+
"performance",
|
|
89
|
+
"protocol-version",
|
|
90
|
+
"security",
|
|
91
|
+
"state-sync",
|
|
92
|
+
"transaction"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"uniqueItems": true,
|
|
96
|
+
"examples": [
|
|
97
|
+
[
|
|
98
|
+
"security",
|
|
99
|
+
"transaction"
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
"performance",
|
|
103
|
+
"event-bus"
|
|
104
|
+
]
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"required": [
|
|
109
|
+
"protocol_version",
|
|
110
|
+
"schema_version"
|
|
111
|
+
],
|
|
112
|
+
"additionalProperties": false,
|
|
113
|
+
"x-mplp-meta": {
|
|
114
|
+
"protocolVersion": "1.0.0",
|
|
115
|
+
"frozen": true,
|
|
116
|
+
"freezeDate": "2025-12-03",
|
|
117
|
+
"governance": "MPGC"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "MPLP v1.0.0 FROZEN – © 2025 邦士(北京)网络科技有限公司 – Apache-2.0 – Governance: MPGC",
|
|
3
|
+
"$id": "https://schemas.mplp.dev/v1.0/common/trace-base.schema.json",
|
|
4
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
+
"title": "MPLP Trace Base",
|
|
6
|
+
"description": "Common base fields for Trace / Span structures. Designed based on W3C Trace Context standard, providing a unified tracing context for the MPLP execution chain. Supports distributed tracing and parent-child relationships of execution steps.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"trace_id": {
|
|
10
|
+
"$ref": "identifiers.schema.json",
|
|
11
|
+
"description": "Identifier for a complete execution chain. All related Spans share the same trace_id."
|
|
12
|
+
},
|
|
13
|
+
"span_id": {
|
|
14
|
+
"$ref": "identifiers.schema.json",
|
|
15
|
+
"description": "Identifier for the current step or operation. Each Span has a unique span_id."
|
|
16
|
+
},
|
|
17
|
+
"parent_span_id": {
|
|
18
|
+
"$ref": "identifiers.schema.json",
|
|
19
|
+
"description": "Identifier of the parent step's span_id. Can be omitted if it is a root span."
|
|
20
|
+
},
|
|
21
|
+
"context_id": {
|
|
22
|
+
"$ref": "identifiers.schema.json",
|
|
23
|
+
"description": "Identifier of the Context Root. Associates the Trace with a specific project context."
|
|
24
|
+
},
|
|
25
|
+
"attributes": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"description": "Additional attributes (key-value pairs) to extend trace information. Can contain custom metadata, tags, etc.",
|
|
28
|
+
"additionalProperties": true,
|
|
29
|
+
"examples": [
|
|
30
|
+
{
|
|
31
|
+
"module": "plan",
|
|
32
|
+
"operation": "create",
|
|
33
|
+
"user_id": "user-123"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"required": [
|
|
39
|
+
"trace_id",
|
|
40
|
+
"span_id"
|
|
41
|
+
],
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"x-mplp-meta": {
|
|
44
|
+
"protocolVersion": "1.0.0",
|
|
45
|
+
"frozen": true,
|
|
46
|
+
"freezeDate": "2025-12-03",
|
|
47
|
+
"governance": "MPGC"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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://mplp.dev/schemas/v1.0/events/mplp-event-core.schema.json",
|
|
5
|
+
"title": "MPLP Core Event v1.0",
|
|
6
|
+
"description": "Base structure for MPLP observability events - provides common fields inherited by all event families",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"event_id": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uuid",
|
|
12
|
+
"description": "Unique identifier for this event (UUID v4)"
|
|
13
|
+
},
|
|
14
|
+
"event_type": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Specific event subtype (e.g., 'import_started', 'pipeline_stage_completed')"
|
|
17
|
+
},
|
|
18
|
+
"event_family": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": [
|
|
21
|
+
"import_process",
|
|
22
|
+
"intent",
|
|
23
|
+
"delta_intent",
|
|
24
|
+
"impact_analysis",
|
|
25
|
+
"compensation_plan",
|
|
26
|
+
"methodology",
|
|
27
|
+
"reasoning_graph",
|
|
28
|
+
"pipeline_stage",
|
|
29
|
+
"graph_update",
|
|
30
|
+
"runtime_execution",
|
|
31
|
+
"cost_budget",
|
|
32
|
+
"external_integration"
|
|
33
|
+
],
|
|
34
|
+
"description": "Event family classification - determines which minimal fields are required"
|
|
35
|
+
},
|
|
36
|
+
"timestamp": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"format": "date-time",
|
|
39
|
+
"description": "ISO 8601 timestamp when event occurred"
|
|
40
|
+
},
|
|
41
|
+
"project_id": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"format": "uuid",
|
|
44
|
+
"description": "Project context identifier (optional for system-level events)"
|
|
45
|
+
},
|
|
46
|
+
"payload": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"description": "Event-specific payload data (schema varies by event_family)"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"required": [
|
|
52
|
+
"event_id",
|
|
53
|
+
"event_type",
|
|
54
|
+
"event_family",
|
|
55
|
+
"timestamp"
|
|
56
|
+
],
|
|
57
|
+
"additionalProperties": true,
|
|
58
|
+
"x-mplp-meta": {
|
|
59
|
+
"protocolVersion": "1.0.0",
|
|
60
|
+
"frozen": true,
|
|
61
|
+
"freezeDate": "2025-12-03",
|
|
62
|
+
"governance": "MPGC"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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://mplp.dev/schemas/v1.0/events/mplp-graph-update-event.schema.json",
|
|
5
|
+
"title": "MPLP GraphUpdateEvent v1.0",
|
|
6
|
+
"description": "**REQUIRED** - PSG structural update events (MANDATORY for v1.0 compliance)",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "mplp-event-core.schema.json"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"event_family": {
|
|
15
|
+
"const": "graph_update",
|
|
16
|
+
"description": "Must be 'graph_update' for this event type"
|
|
17
|
+
},
|
|
18
|
+
"graph_id": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"format": "uuid",
|
|
21
|
+
"description": "PSG identifier (typically project-level graph)"
|
|
22
|
+
},
|
|
23
|
+
"update_kind": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"enum": [
|
|
26
|
+
"node_add",
|
|
27
|
+
"node_update",
|
|
28
|
+
"node_delete",
|
|
29
|
+
"edge_add",
|
|
30
|
+
"edge_update",
|
|
31
|
+
"edge_delete",
|
|
32
|
+
"bulk"
|
|
33
|
+
],
|
|
34
|
+
"description": "Type of graph mutation"
|
|
35
|
+
},
|
|
36
|
+
"node_delta": {
|
|
37
|
+
"type": "integer",
|
|
38
|
+
"description": "Node count delta (+/- or 0)"
|
|
39
|
+
},
|
|
40
|
+
"edge_delta": {
|
|
41
|
+
"type": "integer",
|
|
42
|
+
"description": "Edge count delta (+/- or 0)"
|
|
43
|
+
},
|
|
44
|
+
"source_module": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "L2 module emitting this update (e.g., 'context', 'plan', 'collab')"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"required": [
|
|
50
|
+
"event_family",
|
|
51
|
+
"graph_id",
|
|
52
|
+
"update_kind",
|
|
53
|
+
"node_delta",
|
|
54
|
+
"edge_delta"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"x-mplp-meta": {
|
|
59
|
+
"protocolVersion": "1.0.0",
|
|
60
|
+
"frozen": true,
|
|
61
|
+
"freezeDate": "2025-12-03",
|
|
62
|
+
"governance": "MPGC"
|
|
63
|
+
}
|
|
64
|
+
}
|