@ai-matrx/agents 0.10.3 → 0.10.5
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 +12 -0
- package/dist/index.cjs +26 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +26 -4
- package/dist/index.js.map +1 -1
- package/dist/mandates/index.cjs +2 -2
- package/dist/mandates/index.cjs.map +1 -1
- package/dist/mandates/index.d.cts +4 -4
- package/dist/mandates/index.d.ts +4 -4
- package/dist/mandates/index.js +2 -2
- package/dist/mandates/index.js.map +1 -1
- package/dist/matrx/index.cjs +18 -2
- package/dist/matrx/index.cjs.map +1 -1
- package/dist/matrx/index.js +18 -2
- package/dist/matrx/index.js.map +1 -1
- package/dist/projection/request.cjs +8 -2
- package/dist/projection/request.cjs.map +1 -1
- package/dist/projection/request.d.cts +2 -0
- package/dist/projection/request.d.ts +2 -0
- package/dist/projection/request.js +8 -2
- package/dist/projection/request.js.map +1 -1
- package/dist/react/index.cjs +26 -4
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +3 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +26 -4
- package/dist/react/index.js.map +1 -1
- package/dist/stream/ndjson.cjs +18 -2
- package/dist/stream/ndjson.cjs.map +1 -1
- package/dist/stream/ndjson.d.cts +2 -0
- package/dist/stream/ndjson.d.ts +2 -0
- package/dist/stream/ndjson.js +18 -2
- package/dist/stream/ndjson.js.map +1 -1
- package/mandates/snapshots/keys.0.10.3.json +469 -0
- package/mandates/snapshots/keys.0.10.4.json +469 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.5
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/matrx-agents/v0.10.4..npm/matrx-agents/v0.10.5 -- apps/shared/matrx-agents`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.10.4
|
|
10
|
+
|
|
11
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
12
|
+
`git diff npm/matrx-agents/v0.10.3..npm/matrx-agents/v0.10.4 -- apps/shared/matrx-agents`).
|
|
13
|
+
No source changes intended and no consumer action required.
|
|
14
|
+
|
|
3
15
|
## 0.10.3
|
|
4
16
|
|
|
5
17
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
package/dist/index.cjs
CHANGED
|
@@ -84,17 +84,33 @@ function normalizeMatrxStreamEnvelope(value) {
|
|
|
84
84
|
if (!isRecord(value)) return null;
|
|
85
85
|
if (typeof value.event === "string") {
|
|
86
86
|
const streamSeq = typeof value.stream_seq === "number" && Number.isFinite(value.stream_seq) ? value.stream_seq : void 0;
|
|
87
|
+
const streamId = typeof value.stream_id === "string" ? value.stream_id : void 0;
|
|
87
88
|
return {
|
|
88
89
|
event: value.event,
|
|
89
90
|
data: value.data,
|
|
91
|
+
...streamId === void 0 ? {} : { stream_id: streamId },
|
|
90
92
|
...streamSeq === void 0 ? {} : { stream_seq: streamSeq }
|
|
91
93
|
};
|
|
92
94
|
}
|
|
93
95
|
if (value.e === "c" && typeof value.t === "string") {
|
|
94
|
-
|
|
96
|
+
const streamId = typeof value.stream_id === "string" ? value.stream_id : void 0;
|
|
97
|
+
const streamSeq = typeof value.stream_seq === "number" && Number.isFinite(value.stream_seq) ? value.stream_seq : void 0;
|
|
98
|
+
return {
|
|
99
|
+
event: "chunk",
|
|
100
|
+
data: { text: value.t },
|
|
101
|
+
...streamId === void 0 ? {} : { stream_id: streamId },
|
|
102
|
+
...streamSeq === void 0 ? {} : { stream_seq: streamSeq }
|
|
103
|
+
};
|
|
95
104
|
}
|
|
96
105
|
if (value.e === "r" && typeof value.t === "string") {
|
|
97
|
-
|
|
106
|
+
const streamId = typeof value.stream_id === "string" ? value.stream_id : void 0;
|
|
107
|
+
const streamSeq = typeof value.stream_seq === "number" && Number.isFinite(value.stream_seq) ? value.stream_seq : void 0;
|
|
108
|
+
return {
|
|
109
|
+
event: "reasoning_chunk",
|
|
110
|
+
data: { text: value.t },
|
|
111
|
+
...streamId === void 0 ? {} : { stream_id: streamId },
|
|
112
|
+
...streamSeq === void 0 ? {} : { stream_seq: streamSeq }
|
|
113
|
+
};
|
|
98
114
|
}
|
|
99
115
|
return null;
|
|
100
116
|
}
|
|
@@ -434,6 +450,7 @@ function createAgentRequestProjection(input) {
|
|
|
434
450
|
completion: null,
|
|
435
451
|
error: null,
|
|
436
452
|
lastTransportSeq: 0,
|
|
453
|
+
transportStreamId: null,
|
|
437
454
|
eventCount: 0
|
|
438
455
|
};
|
|
439
456
|
}
|
|
@@ -457,12 +474,17 @@ function toolStatus(event) {
|
|
|
457
474
|
}
|
|
458
475
|
function projectAgentEvent(current, event) {
|
|
459
476
|
const streamSeq = asNumber(event.stream_seq);
|
|
460
|
-
|
|
477
|
+
const streamId = asString(event.stream_id);
|
|
478
|
+
const sameSegment = streamId === null || streamId === current.transportStreamId;
|
|
479
|
+
if (sameSegment && streamSeq !== null && streamSeq <= current.lastTransportSeq) {
|
|
480
|
+
return current;
|
|
481
|
+
}
|
|
461
482
|
const data = asRecord(event.data);
|
|
462
483
|
const next = {
|
|
463
484
|
...current,
|
|
464
485
|
status: current.status === "pending" ? "streaming" : current.status,
|
|
465
|
-
lastTransportSeq: streamSeq
|
|
486
|
+
lastTransportSeq: streamSeq === null ? current.lastTransportSeq : sameSegment ? Math.max(current.lastTransportSeq, streamSeq) : streamSeq,
|
|
487
|
+
transportStreamId: streamId ?? current.transportStreamId,
|
|
466
488
|
eventCount: current.eventCount + 1
|
|
467
489
|
};
|
|
468
490
|
switch (event.event) {
|