@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.mjs
CHANGED
|
@@ -146,6 +146,21 @@ function assertGenericProjectConfig(config) {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
// src/ModelProviderProtocol.ts
|
|
150
|
+
function toModelKey(providerId, modelId) {
|
|
151
|
+
return `${providerId}/${modelId}`;
|
|
152
|
+
}
|
|
153
|
+
function parseModelKey(modelKey) {
|
|
154
|
+
const separator = modelKey.indexOf("/");
|
|
155
|
+
if (separator <= 0 || separator === modelKey.length - 1) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
providerId: modelKey.slice(0, separator),
|
|
160
|
+
modelId: modelKey.slice(separator + 1)
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
149
164
|
// src/BindingProtocol.ts
|
|
150
165
|
var DuplicateChannelBindingSubjectError = class extends Error {
|
|
151
166
|
constructor() {
|
|
@@ -838,9 +853,10 @@ function parseTrustedRunContext(value) {
|
|
|
838
853
|
"threadId",
|
|
839
854
|
"inputMessageId"
|
|
840
855
|
];
|
|
841
|
-
const projectTaskValues = snapshotExactRecord(contextValues.projectTask, requiredKeys2, ["source"]);
|
|
856
|
+
const projectTaskValues = snapshotExactRecord(contextValues.projectTask, requiredKeys2, ["source", "rosterExempt"]);
|
|
842
857
|
const projectTaskHasSource = projectTaskValues !== void 0 && Object.prototype.hasOwnProperty.call(projectTaskValues, "source");
|
|
843
|
-
|
|
858
|
+
const projectTaskHasRosterExempt = projectTaskValues !== void 0 && Object.prototype.hasOwnProperty.call(projectTaskValues, "rosterExempt");
|
|
859
|
+
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") {
|
|
844
860
|
throw new Error("Invalid trusted agent run context");
|
|
845
861
|
}
|
|
846
862
|
const parsedProjectTask = {
|
|
@@ -857,6 +873,9 @@ function parseTrustedRunContext(value) {
|
|
|
857
873
|
if (projectTaskHasSource && typeof projectTaskValues.source === "string") {
|
|
858
874
|
parsedProjectTask.source = projectTaskValues.source;
|
|
859
875
|
}
|
|
876
|
+
if (projectTaskHasRosterExempt && projectTaskValues.rosterExempt === true) {
|
|
877
|
+
parsedProjectTask.rosterExempt = true;
|
|
878
|
+
}
|
|
860
879
|
return { projectTask: parsedProjectTask };
|
|
861
880
|
}
|
|
862
881
|
const projectRoomValue = contextValues?.projectRoom;
|
|
@@ -982,6 +1001,7 @@ export {
|
|
|
982
1001
|
normalizeTaskMetadataScalar,
|
|
983
1002
|
parseAgentWebAppGenUIBlock,
|
|
984
1003
|
parseMcpUiRef,
|
|
1004
|
+
parseModelKey,
|
|
985
1005
|
parseProjectRoomEventId,
|
|
986
1006
|
parseQueuedExecutionMode,
|
|
987
1007
|
parseTaskBeliefState,
|
|
@@ -996,6 +1016,7 @@ export {
|
|
|
996
1016
|
snapshotProjectRoomMembershipRealtime,
|
|
997
1017
|
snapshotProjectRoomMessageRealtime,
|
|
998
1018
|
taskBeliefStatesEqual,
|
|
1019
|
+
toModelKey,
|
|
999
1020
|
toProjectRoomPublicBotMembership,
|
|
1000
1021
|
toProjectRoomPublicMembership,
|
|
1001
1022
|
toProjectRoomPublicMessage
|