@modelprofile.com/flexharness 5.2.0 → 5.3.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/ts/interfaces.ts CHANGED
@@ -944,6 +944,7 @@ export interface IFlexRedoSessionResult {
944
944
  export type TFlexExternalErrorSource =
945
945
  | 'modelResolver'
946
946
  | 'toolProvider'
947
+ | 'delegatedRunAdmissionProvider'
947
948
  | 'toolExecution'
948
949
  | 'toolCallback'
949
950
  | 'toolCleanup'
@@ -964,6 +965,37 @@ export type TFlexExternalErrorProjector = (
964
965
  context: IFlexExternalErrorContext,
965
966
  ) => IFlexErrorInfo;
966
967
 
968
+ export interface IFlexDelegatedRunAdmissionContext<TScope> extends IFlexSessionGeneration {
969
+ readonly scopeId: string;
970
+ readonly scope: TScope;
971
+ readonly storageKey: string;
972
+ readonly sessionId: string;
973
+ readonly sessionGenerationId: string;
974
+ readonly sessionGenerationSequence: number;
975
+ readonly queueId: string;
976
+ readonly runId: string;
977
+ readonly parentSessionId: string;
978
+ readonly parentSessionGenerationId: string;
979
+ readonly parentSessionGenerationSequence: number;
980
+ readonly parentQueueId: string;
981
+ readonly parentRunId: string;
982
+ readonly parentToolCallId: string;
983
+ readonly agent: string;
984
+ readonly depth: number;
985
+ readonly signal: AbortSignal;
986
+ }
987
+
988
+ export interface IFlexDelegatedRunAdmissionLease {
989
+ /** Must be idempotent and safe to retry after a rejected close attempt. */
990
+ close(): Promise<void> | void;
991
+ }
992
+
993
+ export interface IFlexDelegatedRunAdmissionProvider<TScope> {
994
+ acquireDelegatedRunAdmission(
995
+ context: IFlexDelegatedRunAdmissionContext<TScope>,
996
+ ): Promise<IFlexDelegatedRunAdmissionLease> | IFlexDelegatedRunAdmissionLease;
997
+ }
998
+
967
999
  export interface IFlexExecutionContextProviderContext<TScope> {
968
1000
  scopeId: string;
969
1001
  scope: TScope;
@@ -1035,6 +1067,7 @@ export interface IFlexHarnessOptions<TScope> {
1035
1067
  toolProvider?: IFlexToolProvider<TScope>;
1036
1068
  resourceToolProviderResolver?: IFlexResourceToolProviderResolver<TScope>;
1037
1069
  executionContextProvider?: IFlexExecutionContextProvider<TScope>;
1070
+ delegatedRunAdmissionProvider?: IFlexDelegatedRunAdmissionProvider<TScope>;
1038
1071
  stores?: IFlexHarnessStores;
1039
1072
  agentSessionPolicy?: IFlexAgentSessionPolicy<TScope>;
1040
1073
  toolOutputLimits?: IFlexJsonLimits;