@axiom-lattice/protocols 7.6.0 → 7.7.0
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 +51 -3
- package/dist/index.d.ts +51 -3
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/OpenProtocol.ts +6 -2
- package/src/ThreadStoreProtocol.ts +99 -0
- package/src/__tests__/ThreadMonitorProtocol.test.ts +60 -0
package/dist/index.mjs
CHANGED
|
@@ -105,6 +105,50 @@ var MessageChunkTypes = {
|
|
|
105
105
|
THREAD_IDLE: "thread_idle"
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
+
// src/ThreadStoreProtocol.ts
|
|
109
|
+
function classifyThreadMetadata(metadata) {
|
|
110
|
+
if (!metadata) return "conversation";
|
|
111
|
+
if (metadata.source === "project_task" && metadata.kind === "task_execution") {
|
|
112
|
+
return "task_execution";
|
|
113
|
+
}
|
|
114
|
+
if (metadata.source === "project_room" && metadata.kind === "room_presence") {
|
|
115
|
+
return "room_presence";
|
|
116
|
+
}
|
|
117
|
+
if (metadata.source === "open_api") return "open_api";
|
|
118
|
+
if (metadata.source === "web_app") return "web_app";
|
|
119
|
+
if (typeof metadata.cronId === "string" && metadata.cronId.length > 0) {
|
|
120
|
+
return "cron";
|
|
121
|
+
}
|
|
122
|
+
if (typeof metadata.channel === "string" && metadata.channel.length > 0) {
|
|
123
|
+
return "channel";
|
|
124
|
+
}
|
|
125
|
+
return "conversation";
|
|
126
|
+
}
|
|
127
|
+
function toThreadMonitorRecord(thread) {
|
|
128
|
+
const metadata = thread.metadata ?? {};
|
|
129
|
+
const readString = (key) => {
|
|
130
|
+
const value = metadata[key];
|
|
131
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
132
|
+
};
|
|
133
|
+
const workspaceId = readString("workspaceId");
|
|
134
|
+
const projectId = readString("projectId");
|
|
135
|
+
const roomId = readString("roomId");
|
|
136
|
+
const taskId = readString("taskId");
|
|
137
|
+
return {
|
|
138
|
+
id: thread.id,
|
|
139
|
+
tenantId: thread.tenantId,
|
|
140
|
+
assistantId: thread.assistantId,
|
|
141
|
+
kind: classifyThreadMetadata(metadata),
|
|
142
|
+
...workspaceId ? { workspaceId } : {},
|
|
143
|
+
...projectId ? { projectId } : {},
|
|
144
|
+
...roomId ? { roomId } : {},
|
|
145
|
+
...taskId ? { taskId } : {},
|
|
146
|
+
createdAt: thread.createdAt,
|
|
147
|
+
updatedAt: thread.updatedAt,
|
|
148
|
+
...thread.expiresAt ? { expiresAt: thread.expiresAt } : {}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
108
152
|
// src/McpLatticeProtocol.ts
|
|
109
153
|
var McpMessageType = /* @__PURE__ */ ((McpMessageType2) => {
|
|
110
154
|
McpMessageType2["CONNECT"] = "mcp:connect";
|
|
@@ -3029,6 +3073,7 @@ export {
|
|
|
3029
3073
|
assertValidCreateChannelReplyJobInput,
|
|
3030
3074
|
authBrandingAsset,
|
|
3031
3075
|
buildAffinityMissChunk,
|
|
3076
|
+
classifyThreadMetadata,
|
|
3032
3077
|
createAgentWebAppStreamProjectionContext,
|
|
3033
3078
|
descriptorDataValue,
|
|
3034
3079
|
effectiveGrants,
|
|
@@ -3087,6 +3132,7 @@ export {
|
|
|
3087
3132
|
toProjectRoomPublicBotMembership,
|
|
3088
3133
|
toProjectRoomPublicMembership,
|
|
3089
3134
|
toProjectRoomPublicMessage,
|
|
3135
|
+
toThreadMonitorRecord,
|
|
3090
3136
|
validateCustomCss
|
|
3091
3137
|
};
|
|
3092
3138
|
//# sourceMappingURL=index.mjs.map
|