@axiom-lattice/protocols 4.4.1 → 4.5.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 +12 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/TrustedRunContextProtocol.ts +17 -2
- package/src/__tests__/TrustedRunContextProtocol.test.ts +39 -0
package/dist/index.mjs
CHANGED
|
@@ -838,9 +838,10 @@ function parseTrustedRunContext(value) {
|
|
|
838
838
|
"threadId",
|
|
839
839
|
"inputMessageId"
|
|
840
840
|
];
|
|
841
|
-
const projectTaskValues = snapshotExactRecord(contextValues.projectTask, requiredKeys2, ["source"]);
|
|
841
|
+
const projectTaskValues = snapshotExactRecord(contextValues.projectTask, requiredKeys2, ["source", "rosterExempt"]);
|
|
842
842
|
const projectTaskHasSource = projectTaskValues !== void 0 && Object.prototype.hasOwnProperty.call(projectTaskValues, "source");
|
|
843
|
-
|
|
843
|
+
const projectTaskHasRosterExempt = projectTaskValues !== void 0 && Object.prototype.hasOwnProperty.call(projectTaskValues, "rosterExempt");
|
|
844
|
+
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
845
|
throw new Error("Invalid trusted agent run context");
|
|
845
846
|
}
|
|
846
847
|
const parsedProjectTask = {
|
|
@@ -857,6 +858,9 @@ function parseTrustedRunContext(value) {
|
|
|
857
858
|
if (projectTaskHasSource && typeof projectTaskValues.source === "string") {
|
|
858
859
|
parsedProjectTask.source = projectTaskValues.source;
|
|
859
860
|
}
|
|
861
|
+
if (projectTaskHasRosterExempt && projectTaskValues.rosterExempt === true) {
|
|
862
|
+
parsedProjectTask.rosterExempt = true;
|
|
863
|
+
}
|
|
860
864
|
return { projectTask: parsedProjectTask };
|
|
861
865
|
}
|
|
862
866
|
const projectRoomValue = contextValues?.projectRoom;
|