@axiom-lattice/protocols 4.5.0 → 4.6.1

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/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() {
@@ -907,6 +922,21 @@ function parseQueuedExecutionMode(value) {
907
922
  return value;
908
923
  }
909
924
 
925
+ // src/RunScope.ts
926
+ function firstNonEmptyString(...values) {
927
+ for (const value of values) {
928
+ if (typeof value === "string" && value.length > 0) return value;
929
+ }
930
+ return void 0;
931
+ }
932
+ function resolveRunScope(runConfig) {
933
+ const rc = runConfig && typeof runConfig === "object" && !Array.isArray(runConfig) ? runConfig : {};
934
+ return {
935
+ workspaceId: firstNonEmptyString(rc.workspaceId, rc["x-workspace-id"]),
936
+ projectId: firstNonEmptyString(rc.projectId, rc["x-project-id"])
937
+ };
938
+ }
939
+
910
940
  // src/OpenProtocol.ts
911
941
  function effectiveGrants(record) {
912
942
  if (record.grants && record.grants.length > 0) return record.grants;
@@ -971,6 +1001,7 @@ export {
971
1001
  createAgentWebAppStreamProjectionContext,
972
1002
  descriptorDataValue,
973
1003
  effectiveGrants,
1004
+ firstNonEmptyString,
974
1005
  getSubAgentsFromConfig,
975
1006
  getToolsFromConfig,
976
1007
  hasTools,
@@ -986,6 +1017,7 @@ export {
986
1017
  normalizeTaskMetadataScalar,
987
1018
  parseAgentWebAppGenUIBlock,
988
1019
  parseMcpUiRef,
1020
+ parseModelKey,
989
1021
  parseProjectRoomEventId,
990
1022
  parseQueuedExecutionMode,
991
1023
  parseTaskBeliefState,
@@ -994,12 +1026,14 @@ export {
994
1026
  projectRoomUserEventScope,
995
1027
  replaceTaskBeliefState,
996
1028
  requireProjectTaskWorkItemStore,
1029
+ resolveRunScope,
997
1030
  snapshotExactArray,
998
1031
  snapshotExactRecord,
999
1032
  snapshotProjectRoomBotMembershipRealtime,
1000
1033
  snapshotProjectRoomMembershipRealtime,
1001
1034
  snapshotProjectRoomMessageRealtime,
1002
1035
  taskBeliefStatesEqual,
1036
+ toModelKey,
1003
1037
  toProjectRoomPublicBotMembership,
1004
1038
  toProjectRoomPublicMembership,
1005
1039
  toProjectRoomPublicMessage