@axiom-lattice/protocols 4.4.1 → 4.6.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 +65 -0
- package/dist/index.d.mts +670 -1
- package/dist/index.d.ts +670 -1
- package/dist/index.js +25 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ModelLatticeProtocol.ts +10 -0
- package/src/ModelProviderProtocol.ts +821 -0
- package/src/TrustedRunContextProtocol.ts +17 -2
- package/src/__tests__/TrustedRunContextProtocol.test.ts +39 -0
- package/src/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ __export(index_exports, {
|
|
|
64
64
|
normalizeTaskMetadataScalar: () => normalizeTaskMetadataScalar,
|
|
65
65
|
parseAgentWebAppGenUIBlock: () => parseAgentWebAppGenUIBlock,
|
|
66
66
|
parseMcpUiRef: () => parseMcpUiRef,
|
|
67
|
+
parseModelKey: () => parseModelKey,
|
|
67
68
|
parseProjectRoomEventId: () => parseProjectRoomEventId,
|
|
68
69
|
parseQueuedExecutionMode: () => parseQueuedExecutionMode,
|
|
69
70
|
parseTaskBeliefState: () => parseTaskBeliefState,
|
|
@@ -78,6 +79,7 @@ __export(index_exports, {
|
|
|
78
79
|
snapshotProjectRoomMembershipRealtime: () => snapshotProjectRoomMembershipRealtime,
|
|
79
80
|
snapshotProjectRoomMessageRealtime: () => snapshotProjectRoomMessageRealtime,
|
|
80
81
|
taskBeliefStatesEqual: () => taskBeliefStatesEqual,
|
|
82
|
+
toModelKey: () => toModelKey,
|
|
81
83
|
toProjectRoomPublicBotMembership: () => toProjectRoomPublicBotMembership,
|
|
82
84
|
toProjectRoomPublicMembership: () => toProjectRoomPublicMembership,
|
|
83
85
|
toProjectRoomPublicMessage: () => toProjectRoomPublicMessage
|
|
@@ -232,6 +234,21 @@ function assertGenericProjectConfig(config) {
|
|
|
232
234
|
}
|
|
233
235
|
}
|
|
234
236
|
|
|
237
|
+
// src/ModelProviderProtocol.ts
|
|
238
|
+
function toModelKey(providerId, modelId) {
|
|
239
|
+
return `${providerId}/${modelId}`;
|
|
240
|
+
}
|
|
241
|
+
function parseModelKey(modelKey) {
|
|
242
|
+
const separator = modelKey.indexOf("/");
|
|
243
|
+
if (separator <= 0 || separator === modelKey.length - 1) {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
return {
|
|
247
|
+
providerId: modelKey.slice(0, separator),
|
|
248
|
+
modelId: modelKey.slice(separator + 1)
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
|
|
235
252
|
// src/BindingProtocol.ts
|
|
236
253
|
var DuplicateChannelBindingSubjectError = class extends Error {
|
|
237
254
|
constructor() {
|
|
@@ -924,9 +941,10 @@ function parseTrustedRunContext(value) {
|
|
|
924
941
|
"threadId",
|
|
925
942
|
"inputMessageId"
|
|
926
943
|
];
|
|
927
|
-
const projectTaskValues = snapshotExactRecord(contextValues.projectTask, requiredKeys2, ["source"]);
|
|
944
|
+
const projectTaskValues = snapshotExactRecord(contextValues.projectTask, requiredKeys2, ["source", "rosterExempt"]);
|
|
928
945
|
const projectTaskHasSource = projectTaskValues !== void 0 && Object.prototype.hasOwnProperty.call(projectTaskValues, "source");
|
|
929
|
-
|
|
946
|
+
const projectTaskHasRosterExempt = projectTaskValues !== void 0 && Object.prototype.hasOwnProperty.call(projectTaskValues, "rosterExempt");
|
|
947
|
+
if (!projectTaskValues || requiredKeys2.some((key) => typeof projectTaskValues[key] !== "string" || projectTaskValues[key].length === 0) || projectTaskHasSource && projectTaskValues.source !== void 0 && (typeof projectTaskValues.source !== "string" || projectTaskValues.source.length === 0) || projectTaskHasRosterExempt && projectTaskValues.rosterExempt !== void 0 && typeof projectTaskValues.rosterExempt !== "boolean") {
|
|
930
948
|
throw new Error("Invalid trusted agent run context");
|
|
931
949
|
}
|
|
932
950
|
const parsedProjectTask = {
|
|
@@ -943,6 +961,9 @@ function parseTrustedRunContext(value) {
|
|
|
943
961
|
if (projectTaskHasSource && typeof projectTaskValues.source === "string") {
|
|
944
962
|
parsedProjectTask.source = projectTaskValues.source;
|
|
945
963
|
}
|
|
964
|
+
if (projectTaskHasRosterExempt && projectTaskValues.rosterExempt === true) {
|
|
965
|
+
parsedProjectTask.rosterExempt = true;
|
|
966
|
+
}
|
|
946
967
|
return { projectTask: parsedProjectTask };
|
|
947
968
|
}
|
|
948
969
|
const projectRoomValue = contextValues?.projectRoom;
|
|
@@ -1069,6 +1090,7 @@ function parseMcpUiRef(value) {
|
|
|
1069
1090
|
normalizeTaskMetadataScalar,
|
|
1070
1091
|
parseAgentWebAppGenUIBlock,
|
|
1071
1092
|
parseMcpUiRef,
|
|
1093
|
+
parseModelKey,
|
|
1072
1094
|
parseProjectRoomEventId,
|
|
1073
1095
|
parseQueuedExecutionMode,
|
|
1074
1096
|
parseTaskBeliefState,
|
|
@@ -1083,6 +1105,7 @@ function parseMcpUiRef(value) {
|
|
|
1083
1105
|
snapshotProjectRoomMembershipRealtime,
|
|
1084
1106
|
snapshotProjectRoomMessageRealtime,
|
|
1085
1107
|
taskBeliefStatesEqual,
|
|
1108
|
+
toModelKey,
|
|
1086
1109
|
toProjectRoomPublicBotMembership,
|
|
1087
1110
|
toProjectRoomPublicMembership,
|
|
1088
1111
|
toProjectRoomPublicMessage
|