@axiom-lattice/protocols 4.2.0 → 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 +20 -0
- package/dist/index.d.mts +266 -20
- package/dist/index.d.ts +266 -20
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/A2AApiKeyStoreProtocol.ts +18 -0
- package/src/A2AProtocol.ts +3 -11
- package/src/AgentWebAppStreamProjection.ts +21 -0
- package/src/ChannelAdapterProtocol.ts +12 -0
- package/src/MessageProtocol.ts +6 -0
- package/src/OpenProtocol.ts +125 -0
- package/src/PluginProtocol.ts +19 -0
- package/src/ProjectRoomMessageStoreProtocol.ts +4 -1
- package/src/ProjectRoomProtocol.ts +11 -0
- package/src/ProjectRoomRealtimeProtocol.ts +6 -0
- package/src/SandboxPluginProtocol.ts +62 -0
- package/src/SandboxResourceProtocol.ts +5 -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/__tests__/a2a-types.test.ts +0 -6
- package/src/__tests__/open-grants.test.ts +29 -0
- package/src/index.ts +4 -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) {
|
|
@@ -857,6 +883,15 @@ function parseQueuedExecutionMode(value) {
|
|
|
857
883
|
if (value !== "followup") throw new Error("Invalid queued execution mode");
|
|
858
884
|
return value;
|
|
859
885
|
}
|
|
886
|
+
|
|
887
|
+
// src/OpenProtocol.ts
|
|
888
|
+
function effectiveGrants(record) {
|
|
889
|
+
if (record.grants && record.grants.length > 0) return record.grants;
|
|
890
|
+
if (record.assistantIds && record.assistantIds.length > 0) {
|
|
891
|
+
return [{ domain: "agent", items: record.assistantIds }];
|
|
892
|
+
}
|
|
893
|
+
return [{ domain: "agent" }];
|
|
894
|
+
}
|
|
860
895
|
export {
|
|
861
896
|
AgentType,
|
|
862
897
|
ChannelBindingMigrationConflictError,
|
|
@@ -870,6 +905,8 @@ export {
|
|
|
870
905
|
McpMessageType,
|
|
871
906
|
MemoryType,
|
|
872
907
|
MessageChunkTypes,
|
|
908
|
+
PROJECT_ROOM_TASK_DELEGATED_LABEL,
|
|
909
|
+
PROJECT_ROOM_TASK_DELEGATED_SEPARATOR,
|
|
873
910
|
PROJECT_ROOM_USER_CHANNEL_PROJECT,
|
|
874
911
|
PROJECT_TASK_LIFECYCLE_ACTIONS,
|
|
875
912
|
ProjectRoomBrokerCapacityError,
|
|
@@ -883,6 +920,7 @@ export {
|
|
|
883
920
|
assertGenericProjectConfig,
|
|
884
921
|
createAgentWebAppStreamProjectionContext,
|
|
885
922
|
descriptorDataValue,
|
|
923
|
+
effectiveGrants,
|
|
886
924
|
getSubAgentsFromConfig,
|
|
887
925
|
getToolsFromConfig,
|
|
888
926
|
hasTools,
|