@modelprofile.com/flexharness 2.0.0 → 3.0.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/changelog.md ADDED
@@ -0,0 +1,57 @@
1
+ # Changelog
2
+
3
+ ## 2026-08-09 - 3.0.0
4
+
5
+ ### Breaking Changes
6
+
7
+ - migrate runtime to AgentSession-backed split stores (harness)
8
+ - Replaces the single legacy store and runner integration with domain-specific stores for scopes, projections, permissions, Agent events, and tool jobs.
9
+ - Adds scheduled prompts, runtime event APIs, uncertain tool-execution reconciliation, session compaction/archive support, and background execution controls.
10
+ - Introduces durable staged terminal recovery, session tombstones, retryable cleanup ownership, commit-uncertain store errors, and JSON store fsync/disposal handling.
11
+ - Adds a 2.x legacy snapshot migration export and updates documentation and tests for the 3.x persistence model.
12
+
13
+ ## 2026-08-08 - 2.1.0
14
+
15
+ ### Features
16
+
17
+ - add storage namespace retirement (harness)
18
+ - Add retireScope() to stop runtime ownership for resolved storage namespaces without deleting durable snapshots.
19
+ - Fence stale scope resolution and late admissions while draining in-flight persistence, permissions, active runs, and tool cleanup.
20
+ - Coalesce retirement and disposal drains by storage namespace and preserve isolated cleanup error reporting.
21
+ - Document retirement behavior and add lifecycle/resolver tests for concurrency and cleanup paths.
22
+
23
+ ## 2026-08-07 - 2.0.0
24
+
25
+ ### Breaking Changes
26
+
27
+ - project external run errors and add durable prompt/message APIs (harness)
28
+ - Convert untrusted resolver, runner, tool, cleanup, callback, and run-persistence failures to FlexHarnessExternalError before exposing them through completions, audit data, events, or disposal.
29
+ - Add externalErrorProjector support for application-approved external error projection.
30
+ - Add startPrompt() admission semantics plus cursor-based message paging and exact message lookup APIs.
31
+ - Add optional resolved model variant metadata and validate it in persisted/public message data.
32
+ - Harden permission rollback so failed persistence cannot leave remembered grants reusable.
33
+
34
+ ## 2026-08-05 - 1.0.1
35
+
36
+ ### Fixes
37
+
38
+ - publish JSON Schema typings required by public model types (deps)
39
+ - Move @types/json-schema from devDependencies to dependencies so downstream consumers can resolve exported declaration types.
40
+
41
+ ## 2026-08-05 - 1.0.0
42
+
43
+ ### Breaking Changes
44
+
45
+ - Establish the initial 1.0 public API for provider-neutral model sessions.
46
+ - Persist successful-only private model history while keeping failed and cancelled prompts audit-visible.
47
+ - Redact attachment payloads from public messages and events, exposing metadata only.
48
+ - Add revisioned transactional stores, session-scoped permissions, typed immutable events, and explicit lifecycle cleanup.
49
+ - Add minimal session title, archive, and deletion mutations with active-run safety.
50
+ - Coordinate resolver failure without hanging on an unresponsive sibling and close detached late tool handles.
51
+ - Coalesce model callbacks in a bounded run-local buffer instead of persisting every delta.
52
+ - Distinguish owner cancellation from internal failure and require successful tool cleanup before appending history.
53
+ - Terminalize in-memory audit state and emit terminal events once when final persistence fails.
54
+ - Enforce JSON output byte limits incrementally while traversing large values.
55
+ - Linearize cancellation at terminal persistence and keep disposal waiting for committing runs.
56
+ - Serialize permission checks behind persistence so uncommitted remembered grants are never observable.
57
+ - Track detached tool-provider cleanup through disposal and report late close failures.
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@modelprofile.com/flexharness',
6
- version: '2.0.0',
6
+ version: '3.0.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,18 +1,24 @@
1
- import type { IFlexCreateSessionOptions, IFlexHarnessOptions, IFlexMessage, IFlexMessagePage, IFlexMessagePageOptions, IFlexPermissionRequest, IFlexPromptOptions, IFlexPromptAdmission, IFlexPromptResult, IFlexSession, IFlexUpdateSessionOptions, TFlexHarnessEventListener, TFlexPermissionDecision, TFlexPrompt } from './interfaces.js';
1
+ import type { IFlexBackgroundExecution, IFlexCreateSessionOptions, IFlexEventArchiveMetadata, IFlexHarnessOptions, IFlexMessage, IFlexMessagePage, IFlexMessagePageOptions, IFlexPermissionRequest, IFlexPromptAdmission, IFlexPromptOptions, IFlexPromptResult, IFlexScheduledPromptAdmission, IFlexSchedulePromptOptions, IFlexSession, IFlexUncertainToolExecution, IFlexUpdateSessionOptions, IJsonObject, TFlexHarnessEventListener, TFlexPermissionDecision, TFlexPrompt, TFlexToolExecutionReconciliation } from './interfaces.js';
2
2
  export declare class FlexHarness<TScope = unknown> {
3
3
  private readonly scopeResolver;
4
4
  private readonly modelResolver;
5
5
  private readonly toolProvider;
6
- private readonly store;
7
- private readonly runner;
6
+ private readonly executionContextProvider;
7
+ private readonly stores;
8
+ private readonly agentSessionPolicy;
8
9
  private readonly toolOutputLimits;
9
10
  private readonly callbackLimits;
10
11
  private readonly externalErrorProjector?;
11
12
  private readonly stateLoads;
13
+ private readonly scopeAdmissions;
14
+ private readonly scopeRetirements;
15
+ private readonly storageDrains;
16
+ private orphanedResourceQueue;
12
17
  private readonly listeners;
13
- private readonly detachedToolCleanups;
14
- private readonly detachedToolCleanupErrors;
15
18
  private readonly trustedInternalErrors;
19
+ private readonly orphanedStoredSessions;
20
+ private readonly orphanedExecutionContexts;
21
+ private readonly orphanedProviderReleases;
16
22
  private sequence;
17
23
  private closed;
18
24
  private disposePromise?;
@@ -22,22 +28,41 @@ export declare class FlexHarness<TScope = unknown> {
22
28
  getSession(scopeId: string, sessionId: string): Promise<IFlexSession>;
23
29
  updateSession(scopeId: string, sessionId: string, options: IFlexUpdateSessionOptions): Promise<IFlexSession>;
24
30
  deleteSession(scopeId: string, sessionId: string): Promise<void>;
31
+ private deleteSessionInternal;
25
32
  getMessages(scopeId: string, sessionId: string): Promise<IFlexMessage[]>;
26
33
  listMessagePage(scopeId: string, sessionId: string, options?: IFlexMessagePageOptions): Promise<IFlexMessagePage>;
27
34
  getMessage(scopeId: string, sessionId: string, messageId: string): Promise<IFlexMessage>;
28
35
  prompt(scopeId: string, sessionId: string, prompt: TFlexPrompt, options?: IFlexPromptOptions): Promise<IFlexPromptResult>;
29
36
  startPrompt(scopeId: string, sessionId: string, prompt: TFlexPrompt, options?: IFlexPromptOptions): Promise<IFlexPromptAdmission>;
30
- abort(scopeId: string, sessionId: string, _reason?: string): Promise<boolean>;
37
+ schedulePrompt(scopeId: string, sessionId: string, scheduleKey: string, prompt: TFlexPrompt, options?: IFlexSchedulePromptOptions): Promise<IFlexScheduledPromptAdmission>;
38
+ cancelScheduledPrompt(scopeId: string, sessionId: string, scheduleKey: string): Promise<boolean>;
39
+ abort(scopeId: string, sessionId: string): Promise<boolean>;
31
40
  listPendingPermissions(scopeId: string, sessionId?: string): Promise<IFlexPermissionRequest[]>;
32
41
  respondToPermission(scopeId: string, sessionId: string, permissionId: string, decision: TFlexPermissionDecision): Promise<void>;
42
+ listUncertainToolExecutions(scopeId: string, sessionId: string): Promise<IFlexUncertainToolExecution[]>;
43
+ reconcileToolExecution(scopeId: string, sessionId: string, intentId: string, reconciliation: TFlexToolExecutionReconciliation): Promise<void>;
44
+ pushRuntimeEvent(scopeId: string, sessionId: string, event: IJsonObject & {
45
+ type: string;
46
+ }): Promise<void>;
47
+ compactSession(scopeId: string, sessionId: string): Promise<void>;
48
+ archiveSessionEvents(scopeId: string, sessionId: string, compactionEventId?: string): Promise<IFlexEventArchiveMetadata | undefined>;
49
+ listBackgroundExecutions(scopeId: string, sessionId: string): Promise<IFlexBackgroundExecution[]>;
50
+ getBackgroundExecution(scopeId: string, sessionId: string, executionId: string): Promise<IFlexBackgroundExecution>;
51
+ abortBackgroundExecution(scopeId: string, sessionId: string, executionId: string): Promise<void>;
33
52
  subscribe(listener: TFlexHarnessEventListener): () => void;
53
+ retireScope(scopeId: string): Promise<void>;
34
54
  dispose(): Promise<void>;
35
- private disposeInternal;
55
+ private admitPrompt;
36
56
  private executeRun;
37
- private reserveRun;
38
- private finalizeRun;
39
- private applyRunFinalState;
40
- private emitFinalMutationEvents;
57
+ private finishFailedRun;
58
+ private prepareGeneration;
59
+ private createReservation;
60
+ private buildTerminal;
61
+ private promoteCompletedTerminal;
62
+ private publishFailedTerminal;
63
+ private replaceStagedTerminal;
64
+ private replaceVisibleRun;
65
+ private emitTerminalProjection;
41
66
  private emitFinalRunEvent;
42
67
  private onTextDelta;
43
68
  private onReasoningStart;
@@ -45,32 +70,76 @@ export declare class FlexHarness<TScope = unknown> {
45
70
  private onReasoningEnd;
46
71
  private onToolStart;
47
72
  private onToolFinish;
73
+ private callbackRun;
48
74
  private reserveCallbackCapacity;
75
+ private failCallback;
49
76
  private requestPermission;
50
77
  private applyPermissionResponse;
78
+ private rollbackRememberedGrant;
79
+ private reconcileRememberedPermissionRemoval;
51
80
  private rejectRunPermissions;
52
81
  private rejectPending;
53
82
  private forceRejectPending;
54
- private emitPartEvent;
83
+ private cancelRun;
55
84
  private abortRunInternally;
56
- private projectExternalError;
57
- private trustInternalError;
85
+ private rollbackAdmission;
58
86
  private normalizeToolHandle;
59
- private trackDetachedToolCleanup;
87
+ private closePartialToolHandle;
88
+ private retainDetachedCleanup;
60
89
  private observeDetachedToolProvider;
61
- private emitEvent;
62
- private resolveState;
90
+ private trackDetachedCleanup;
91
+ private runDetachedCleanup;
92
+ private beginDetachedCleanupSettlement;
93
+ private settleDetachedCleanups;
94
+ private projectExternalError;
95
+ private projectOperationError;
96
+ private trustInternalError;
97
+ private canonicalOutcomes;
98
+ private durableCanonicalOutcomes;
63
99
  private loadState;
64
- private mutateAndSave;
65
- private restorePersistentState;
66
- private createSnapshot;
100
+ private createUninitializedStoredSession;
101
+ private loadSessionRuntime;
102
+ private repairLoadedSession;
103
+ private repairTerminal;
104
+ private mutateScope;
105
+ private mutateProjection;
106
+ private mutatePermissions;
107
+ private createScopeSnapshot;
108
+ private createProjectionSnapshot;
109
+ private cleanupSessionDomains;
110
+ private finishTombstoneCleanup;
111
+ private finishTombstoneCleanupInternal;
112
+ private fenceNamespace;
113
+ private closeStoredSession;
114
+ private abortStoredSession;
115
+ private storedSessionCleanupCompleted;
116
+ private releasePartialProviderSession;
117
+ private retainPartialProviderSession;
118
+ private hasOrphanedSessionResources;
119
+ private closeOrphanedResources;
120
+ private closeOrphanedResourcesInternal;
121
+ private orphanedResourceStorageKeys;
122
+ private retireScopeInternal;
123
+ private drainStorage;
124
+ private drainStorageInternal;
125
+ private disposeInternal;
126
+ private appendUnexpectedErrors;
127
+ private resolveState;
128
+ private getScopeAdmission;
129
+ private pruneScopeAdmission;
130
+ private createScopeRetirementError;
131
+ private assertStateAcceptingWork;
132
+ private requireSession;
133
+ private requireMutableSession;
134
+ private requireMessage;
135
+ private isTombstoned;
136
+ private emitPartEvent;
137
+ private emitEvent;
138
+ private validateRuntimeEvent;
139
+ private projectBackgroundExecution;
140
+ private boundedIdentifier;
67
141
  private messageCursorNamespace;
68
142
  private createMessageCursor;
69
143
  private parseMessageCursor;
70
- private resolveRunAdmission;
71
- private rejectRunAdmission;
72
- private requireSession;
73
- private requireMessage;
74
- private requireMutableSession;
75
144
  private assertOpen;
76
145
  }