macp-sdk-typescript 0.17.0 → 0.17.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/CHANGELOG.md +7 -0
- package/dist/decision.js +3 -0
- package/dist/validation.d.ts +13 -1
- package/dist/validation.js +12 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ All notable changes to `macp-sdk-typescript` are documented here. The format
|
|
|
4
4
|
follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the
|
|
5
5
|
project uses [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [0.17.1](https://github.com/multiagentcoordinationprotocol/macp-sdk-typescript/compare/v0.17.0...v0.17.1) (2026-10-20)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **validation:** accept an empty participant list on a Decision SessionStart ([#186](https://github.com/multiagentcoordinationprotocol/macp-sdk-typescript/issues/186)) ([543a86c](https://github.com/multiagentcoordinationprotocol/macp-sdk-typescript/commit/543a86c1a0996130baae709c6f31687b3bf490b8))
|
|
13
|
+
|
|
7
14
|
## [0.17.0](https://github.com/multiagentcoordinationprotocol/macp-sdk-typescript/compare/v0.16.1...v0.17.0) (2026-10-18)
|
|
8
15
|
|
|
9
16
|
|
package/dist/decision.js
CHANGED
|
@@ -43,6 +43,9 @@ class DecisionSession {
|
|
|
43
43
|
maxSuspendMs: input.maxSuspendMs,
|
|
44
44
|
modeVersion: this.modeVersion,
|
|
45
45
|
configurationVersion: this.configurationVersion,
|
|
46
|
+
// The runtime accepts an empty roster for Decision only (an inert
|
|
47
|
+
// session: no Proposal is ever admitted); the other modes reject it.
|
|
48
|
+
allowEmptyParticipants: true,
|
|
46
49
|
});
|
|
47
50
|
const payload = (0, envelope_1.buildSessionStartPayload)({
|
|
48
51
|
intent: input.intent,
|
package/dist/validation.d.ts
CHANGED
|
@@ -41,7 +41,18 @@ export declare function validateSignalType(signalType: string, data?: Buffer | U
|
|
|
41
41
|
export declare function validateProgressScope(sessionId: string, mode: string): void;
|
|
42
42
|
export declare function validateTtlMs(ttlMs: number): void;
|
|
43
43
|
export declare function validateMaxSuspendMs(maxSuspendMs: number): void;
|
|
44
|
-
|
|
44
|
+
/**
|
|
45
|
+
* `allowEmpty` skips the non-empty check only -- the duplicate check and the
|
|
46
|
+
* count limit still apply. Decision mode is the sole caller of
|
|
47
|
+
* `allowEmpty: true` (via `validateSessionStart`): the runtime accepts an empty
|
|
48
|
+
* `participants` list for a Decision `SessionStart` and rejects it for every
|
|
49
|
+
* other mode (macp-runtime `allows_empty_participants`; spec fixture
|
|
50
|
+
* `decision_zero_participants.json`). Same shape as macp-sdk-python's
|
|
51
|
+
* `validate_participants(..., allow_empty=...)`.
|
|
52
|
+
*/
|
|
53
|
+
export declare function validateParticipants(participants: string[], options?: {
|
|
54
|
+
allowEmpty?: boolean;
|
|
55
|
+
}): void;
|
|
45
56
|
export declare function validateRequiredField(fieldName: string, value: string): void;
|
|
46
57
|
export declare function validateCommitmentHash(value: string, field?: string): void;
|
|
47
58
|
export declare function validateSessionStart(input: {
|
|
@@ -51,4 +62,5 @@ export declare function validateSessionStart(input: {
|
|
|
51
62
|
maxSuspendMs?: number;
|
|
52
63
|
modeVersion: string;
|
|
53
64
|
configurationVersion: string;
|
|
65
|
+
allowEmptyParticipants?: boolean;
|
|
54
66
|
}): void;
|
package/dist/validation.js
CHANGED
|
@@ -139,8 +139,17 @@ function validateMaxSuspendMs(maxSuspendMs) {
|
|
|
139
139
|
throw new errors_1.MacpSessionError(`max_suspend_ms must be >= 0 (0 = runtime default), got ${maxSuspendMs}`);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
/**
|
|
143
|
+
* `allowEmpty` skips the non-empty check only -- the duplicate check and the
|
|
144
|
+
* count limit still apply. Decision mode is the sole caller of
|
|
145
|
+
* `allowEmpty: true` (via `validateSessionStart`): the runtime accepts an empty
|
|
146
|
+
* `participants` list for a Decision `SessionStart` and rejects it for every
|
|
147
|
+
* other mode (macp-runtime `allows_empty_participants`; spec fixture
|
|
148
|
+
* `decision_zero_participants.json`). Same shape as macp-sdk-python's
|
|
149
|
+
* `validate_participants(..., allow_empty=...)`.
|
|
150
|
+
*/
|
|
151
|
+
function validateParticipants(participants, options = {}) {
|
|
152
|
+
if (!participants.length && !options.allowEmpty) {
|
|
144
153
|
throw new errors_1.MacpSessionError('participants must be non-empty');
|
|
145
154
|
}
|
|
146
155
|
const seen = new Set();
|
|
@@ -169,7 +178,7 @@ function validateSessionStart(input) {
|
|
|
169
178
|
// RFC-MACP-0001 §7.1 states a runtime "MUST NOT reject a SessionStart
|
|
170
179
|
// solely because intent is empty" -- no client-side non-empty check here
|
|
171
180
|
// (issue #124 item 3).
|
|
172
|
-
validateParticipants(input.participants);
|
|
181
|
+
validateParticipants(input.participants, { allowEmpty: input.allowEmptyParticipants });
|
|
173
182
|
validateTtlMs(input.ttlMs);
|
|
174
183
|
if (input.maxSuspendMs !== undefined)
|
|
175
184
|
validateMaxSuspendMs(input.maxSuspendMs);
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED