@axiom-lattice/protocols 7.6.0 → 7.8.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 +42 -0
- package/dist/index.d.mts +124 -3
- package/dist/index.d.ts +124 -3
- package/dist/index.js +87 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +82 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ChannelInstallationStoreProtocol.ts +37 -0
- package/src/OpenProtocol.ts +6 -2
- package/src/PlatformSettingsProtocol.ts +24 -3
- package/src/SessionStoreProtocol.ts +40 -0
- package/src/ThreadStoreProtocol.ts +99 -0
- package/src/UserStoreProtocol.ts +3 -0
- package/src/__tests__/ThreadMonitorProtocol.test.ts +60 -0
- package/src/index.ts +1 -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";
|
|
@@ -138,6 +182,29 @@ function assertGenericProjectConfig(config) {
|
|
|
138
182
|
}
|
|
139
183
|
}
|
|
140
184
|
|
|
185
|
+
// src/ChannelInstallationStoreProtocol.ts
|
|
186
|
+
var CHANNEL_INSTALLATION_SECRET_FIELDS = [
|
|
187
|
+
"appSecret",
|
|
188
|
+
"verificationToken",
|
|
189
|
+
"encryptKey",
|
|
190
|
+
"botToken",
|
|
191
|
+
"secret"
|
|
192
|
+
];
|
|
193
|
+
var CHANNEL_INSTALLATION_SECRET_MASK = "********";
|
|
194
|
+
function maskChannelInstallationSecrets(installation) {
|
|
195
|
+
const config = installation.config;
|
|
196
|
+
if (config === null || typeof config !== "object" || Array.isArray(config)) {
|
|
197
|
+
return installation;
|
|
198
|
+
}
|
|
199
|
+
const masked = { ...config };
|
|
200
|
+
for (const field of CHANNEL_INSTALLATION_SECRET_FIELDS) {
|
|
201
|
+
if (typeof masked[field] === "string" && masked[field] !== "") {
|
|
202
|
+
masked[field] = CHANNEL_INSTALLATION_SECRET_MASK;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return { ...installation, config: masked };
|
|
206
|
+
}
|
|
207
|
+
|
|
141
208
|
// src/McpServerConfigStoreProtocol.ts
|
|
142
209
|
function isPersonalMcpServerConfigStore(store) {
|
|
143
210
|
const candidate = store;
|
|
@@ -2640,7 +2707,16 @@ var PlatformSettingsVersionConflictError = class extends Error {
|
|
|
2640
2707
|
}
|
|
2641
2708
|
};
|
|
2642
2709
|
var PLATFORM_SETTINGS_DEFAULTS = {
|
|
2643
|
-
auth: {
|
|
2710
|
+
auth: {
|
|
2711
|
+
emailCompletionEnabled: false,
|
|
2712
|
+
session: {
|
|
2713
|
+
refreshEnabled: true,
|
|
2714
|
+
accessTtlSeconds: 86400,
|
|
2715
|
+
refreshIdleSeconds: 604800,
|
|
2716
|
+
refreshAbsoluteSeconds: 2592e3,
|
|
2717
|
+
refreshReuseGraceSeconds: 20
|
|
2718
|
+
}
|
|
2719
|
+
},
|
|
2644
2720
|
invite: { defaultExpiresInHours: 168, defaultMaxUses: 1 },
|
|
2645
2721
|
rateLimits: {
|
|
2646
2722
|
openApiPerMinute: 6e4,
|
|
@@ -2963,6 +3039,8 @@ export {
|
|
|
2963
3039
|
BRANDING_PERCENT_KEYS,
|
|
2964
3040
|
BRANDING_TEXT_KEYS,
|
|
2965
3041
|
BRANDING_VIDEO_URL_KEYS,
|
|
3042
|
+
CHANNEL_INSTALLATION_SECRET_FIELDS,
|
|
3043
|
+
CHANNEL_INSTALLATION_SECRET_MASK,
|
|
2966
3044
|
CHANNEL_REPLY_JOB_LIST_LIMIT_DEFAULT,
|
|
2967
3045
|
CHANNEL_REPLY_JOB_LIST_LIMIT_MAX,
|
|
2968
3046
|
CHANNEL_REPLY_JOB_LIST_LIMIT_MIN,
|
|
@@ -3029,6 +3107,7 @@ export {
|
|
|
3029
3107
|
assertValidCreateChannelReplyJobInput,
|
|
3030
3108
|
authBrandingAsset,
|
|
3031
3109
|
buildAffinityMissChunk,
|
|
3110
|
+
classifyThreadMetadata,
|
|
3032
3111
|
createAgentWebAppStreamProjectionContext,
|
|
3033
3112
|
descriptorDataValue,
|
|
3034
3113
|
effectiveGrants,
|
|
@@ -3052,6 +3131,7 @@ export {
|
|
|
3052
3131
|
isWorkspacePublicRoomProjectId,
|
|
3053
3132
|
layoutSpecificFields,
|
|
3054
3133
|
layoutSupportsSurface,
|
|
3134
|
+
maskChannelInstallationSecrets,
|
|
3055
3135
|
normalizeAllowedPrivateHosts,
|
|
3056
3136
|
normalizeBrandingHost,
|
|
3057
3137
|
normalizeChannelReplyJobListLimit,
|
|
@@ -3087,6 +3167,7 @@ export {
|
|
|
3087
3167
|
toProjectRoomPublicBotMembership,
|
|
3088
3168
|
toProjectRoomPublicMembership,
|
|
3089
3169
|
toProjectRoomPublicMessage,
|
|
3170
|
+
toThreadMonitorRecord,
|
|
3090
3171
|
validateCustomCss
|
|
3091
3172
|
};
|
|
3092
3173
|
//# sourceMappingURL=index.mjs.map
|