@axiom-lattice/protocols 4.2.1 → 4.2.2
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +14 -0
- package/dist/index.d.mts +54 -1
- package/dist/index.d.ts +54 -1
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/AgentWebAppStreamProjection.ts +21 -0
- package/src/ChannelAdapterProtocol.ts +12 -0
- package/src/MessageProtocol.ts +6 -0
- package/src/ProjectRoomProtocol.ts +11 -0
- package/src/ProjectRoomRealtimeProtocol.ts +6 -0
- package/src/UserPushSubscriptionStoreProtocol.ts +25 -0
- package/src/__tests__/AgentWebAppStreamProjection.test.ts +59 -0
- package/src/__tests__/ProjectRoomRealtimeProtocol.test.ts +2 -2
- package/src/index.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -107,6 +107,7 @@ var MessageChunkTypes = {
|
|
|
107
107
|
AI: "ai",
|
|
108
108
|
TOOL: "tool",
|
|
109
109
|
INTERRUPT: "interrupt",
|
|
110
|
+
ERROR: "error",
|
|
110
111
|
MESSAGE_COMPLETED: "message_completed",
|
|
111
112
|
MESSAGE_FAILED: "message_failed",
|
|
112
113
|
THREAD_IDLE: "thread_idle"
|
|
@@ -494,6 +495,23 @@ function projectAgentWebAppChunk(chunk, context) {
|
|
|
494
495
|
{ type: "stream.completed" }
|
|
495
496
|
];
|
|
496
497
|
}
|
|
498
|
+
if (chunk.type === MessageChunkTypes.ERROR) {
|
|
499
|
+
const code = typeof chunk.data.code === "string" ? chunk.data.code : "stream_error";
|
|
500
|
+
if (code === "aborted" || code === "superseded") {
|
|
501
|
+
return [{ type: "stream.completed" }];
|
|
502
|
+
}
|
|
503
|
+
return [
|
|
504
|
+
{
|
|
505
|
+
type: "error",
|
|
506
|
+
error: {
|
|
507
|
+
code: "STREAM_FAILED",
|
|
508
|
+
message: typeof chunk.data.content === "string" && chunk.data.content ? chunk.data.content : "Stream failed",
|
|
509
|
+
retryable: false
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
{ type: "stream.completed" }
|
|
513
|
+
];
|
|
514
|
+
}
|
|
497
515
|
if (chunk.type === MessageChunkTypes.MESSAGE_FAILED) {
|
|
498
516
|
return [
|
|
499
517
|
{ type: "error", error: { code: "STREAM_FAILED", message: "Stream failed", retryable: true } },
|
|
@@ -530,6 +548,10 @@ function isRecord2(value) {
|
|
|
530
548
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
531
549
|
}
|
|
532
550
|
|
|
551
|
+
// src/ProjectRoomProtocol.ts
|
|
552
|
+
var PROJECT_ROOM_TASK_DELEGATED_LABEL = "Task delegated";
|
|
553
|
+
var PROJECT_ROOM_TASK_DELEGATED_SEPARATOR = " \xB7 ";
|
|
554
|
+
|
|
533
555
|
// src/ExactDataSnapshot.ts
|
|
534
556
|
function ownDescriptorField(descriptor, key) {
|
|
535
557
|
const field = Object.getOwnPropertyDescriptor(descriptor, key);
|
|
@@ -670,6 +692,10 @@ function mapPublicMessageRecord(record) {
|
|
|
670
692
|
if (typeof record.replyToMessageId !== "string") return void 0;
|
|
671
693
|
result.replyToMessageId = record.replyToMessageId;
|
|
672
694
|
}
|
|
695
|
+
if (record.sourceId !== void 0) {
|
|
696
|
+
if (typeof record.sourceId !== "string") return void 0;
|
|
697
|
+
result.sourceId = record.sourceId;
|
|
698
|
+
}
|
|
673
699
|
return result;
|
|
674
700
|
}
|
|
675
701
|
function snapshotPublicMentions(value) {
|
|
@@ -879,6 +905,8 @@ export {
|
|
|
879
905
|
McpMessageType,
|
|
880
906
|
MemoryType,
|
|
881
907
|
MessageChunkTypes,
|
|
908
|
+
PROJECT_ROOM_TASK_DELEGATED_LABEL,
|
|
909
|
+
PROJECT_ROOM_TASK_DELEGATED_SEPARATOR,
|
|
882
910
|
PROJECT_ROOM_USER_CHANNEL_PROJECT,
|
|
883
911
|
PROJECT_TASK_LIFECYCLE_ACTIONS,
|
|
884
912
|
ProjectRoomBrokerCapacityError,
|