@modelprofile.com/flexharness 1.0.1 → 2.1.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.
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@modelprofile.com/flexharness',
6
- version: '1.0.1',
6
+ version: '2.1.0',
7
7
  description: 'Provider-neutral model-session runtime with durable history, permissions, typed events, and pluggable local or remote tool execution.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSwrQkFBK0I7SUFDckMsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHVJQUF1STtDQUNySixDQUFBIn0=
@@ -1,4 +1,4 @@
1
- import type { IFlexCreateSessionOptions, IFlexHarnessOptions, IFlexMessage, IFlexPermissionRequest, IFlexPromptOptions, IFlexPromptResult, IFlexSession, IFlexUpdateSessionOptions, TFlexHarnessEventListener, TFlexPermissionDecision, TFlexPrompt } from './interfaces.js';
1
+ import type { IFlexCreateSessionOptions, IFlexHarnessOptions, IFlexMessage, IFlexMessagePage, IFlexMessagePageOptions, IFlexPermissionRequest, IFlexPromptOptions, IFlexPromptAdmission, IFlexPromptResult, IFlexSession, IFlexUpdateSessionOptions, TFlexHarnessEventListener, TFlexPermissionDecision, TFlexPrompt } from './interfaces.js';
2
2
  export declare class FlexHarness<TScope = unknown> {
3
3
  private readonly scopeResolver;
4
4
  private readonly modelResolver;
@@ -7,9 +7,14 @@ export declare class FlexHarness<TScope = unknown> {
7
7
  private readonly runner;
8
8
  private readonly toolOutputLimits;
9
9
  private readonly callbackLimits;
10
+ private readonly externalErrorProjector?;
10
11
  private readonly stateLoads;
12
+ private readonly scopeAdmissions;
13
+ private readonly scopeRetirements;
14
+ private readonly storageDrains;
11
15
  private readonly listeners;
12
16
  private readonly detachedToolCleanups;
17
+ private readonly trustedInternalErrors;
13
18
  private sequence;
14
19
  private closed;
15
20
  private disposePromise?;
@@ -20,11 +25,15 @@ export declare class FlexHarness<TScope = unknown> {
20
25
  updateSession(scopeId: string, sessionId: string, options: IFlexUpdateSessionOptions): Promise<IFlexSession>;
21
26
  deleteSession(scopeId: string, sessionId: string): Promise<void>;
22
27
  getMessages(scopeId: string, sessionId: string): Promise<IFlexMessage[]>;
28
+ listMessagePage(scopeId: string, sessionId: string, options?: IFlexMessagePageOptions): Promise<IFlexMessagePage>;
29
+ getMessage(scopeId: string, sessionId: string, messageId: string): Promise<IFlexMessage>;
23
30
  prompt(scopeId: string, sessionId: string, prompt: TFlexPrompt, options?: IFlexPromptOptions): Promise<IFlexPromptResult>;
24
- abort(scopeId: string, sessionId: string, reason?: string): Promise<boolean>;
31
+ startPrompt(scopeId: string, sessionId: string, prompt: TFlexPrompt, options?: IFlexPromptOptions): Promise<IFlexPromptAdmission>;
32
+ abort(scopeId: string, sessionId: string, _reason?: string): Promise<boolean>;
25
33
  listPendingPermissions(scopeId: string, sessionId?: string): Promise<IFlexPermissionRequest[]>;
26
34
  respondToPermission(scopeId: string, sessionId: string, permissionId: string, decision: TFlexPermissionDecision): Promise<void>;
27
35
  subscribe(listener: TFlexHarnessEventListener): () => void;
36
+ retireScope(scopeId: string): Promise<void>;
28
37
  dispose(): Promise<void>;
29
38
  private disposeInternal;
30
39
  private executeRun;
@@ -47,13 +56,32 @@ export declare class FlexHarness<TScope = unknown> {
47
56
  private forceRejectPending;
48
57
  private emitPartEvent;
49
58
  private abortRunInternally;
59
+ private projectExternalError;
60
+ private trustInternalError;
61
+ private normalizeToolHandle;
62
+ private trackDetachedToolCleanup;
50
63
  private observeDetachedToolProvider;
51
64
  private emitEvent;
65
+ private getScopeAdmission;
66
+ private pruneScopeAdmission;
67
+ private retireScopeInternal;
68
+ private drainStorage;
69
+ private drainStorageInternal;
70
+ private drainDetachedToolCleanups;
71
+ private appendUnexpectedErrors;
72
+ private waitForReadableState;
73
+ private assertStateAcceptingWork;
74
+ private createScopeRetirementError;
52
75
  private resolveState;
53
76
  private loadState;
54
77
  private mutateAndSave;
55
78
  private restorePersistentState;
56
79
  private createSnapshot;
80
+ private messageCursorNamespace;
81
+ private createMessageCursor;
82
+ private parseMessageCursor;
83
+ private resolveRunAdmission;
84
+ private rejectRunAdmission;
57
85
  private requireSession;
58
86
  private requireMessage;
59
87
  private requireMutableSession;