@modelprofile.com/flexharness 3.6.0 → 3.8.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 +18 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.flexharness.d.ts +71 -1
- package/dist_ts/classes.flexharness.js +2374 -138
- package/dist_ts/classes.stores.js +1 -1
- package/dist_ts/errors.d.ts +8 -0
- package/dist_ts/errors.js +17 -1
- package/dist_ts/index.d.ts +1 -0
- package/dist_ts/index.js +2 -1
- package/dist_ts/interfaces.d.ts +272 -5
- package/dist_ts/interfaces.js +18 -2
- package/dist_ts/plugins.d.ts +2 -2
- package/dist_ts/plugins.js +3 -3
- package/dist_ts/utils.json.d.ts +5 -2
- package/dist_ts/utils.json.js +485 -10
- package/dist_ts/utils.slashcommands.d.ts +7 -0
- package/dist_ts/utils.slashcommands.js +164 -0
- package/dist_ts_migration/v3_legacyflexharness.js +6 -2
- package/package.json +1 -1
- package/readme.hints.md +4 -0
- package/readme.md +190 -3
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.flexharness.ts +3210 -190
- package/ts/classes.stores.ts +9 -8
- package/ts/errors.ts +25 -0
- package/ts/index.ts +4 -0
- package/ts/interfaces.ts +378 -5
- package/ts/plugins.ts +2 -0
- package/ts/utils.json.ts +543 -12
- package/ts/utils.slashcommands.ts +178 -0
- package/ts_migration/v3_legacyflexharness.ts +10 -5
package/changelog.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-08-14 - 3.8.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add workspace-required turn reversion (harness)
|
|
8
|
+
- Add a versioned provider contract for revertible, no-change, and nonrevertible workspace outcomes with bounded affected-workspace metadata.
|
|
9
|
+
- Add workspace-required history grouping, nonrevertible barriers, and public reversion information while preserving the existing transcript-optional policy.
|
|
10
|
+
- Upgrade projection persistence to schema version 3 with version 1 and 2 loading, durable cleanup ownership, and crash-safe apply and deletion recovery.
|
|
11
|
+
|
|
12
|
+
## 2026-08-13 - 3.7.0
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- add native slash commands and turn reversion (harness)
|
|
17
|
+
- Add built-in, template, and typed-handler slash commands with authoritative parsing, availability, execution, and literal unknown-command fallback.
|
|
18
|
+
- Add durable grouped undo and redo with optional workspace capture, crash recovery, branch commitment, release ownership, and archival horizons.
|
|
19
|
+
- Upgrade projection persistence to schema version 2 while preserving version 1 loading, and document the public command and reversion contracts.
|
|
20
|
+
|
|
3
21
|
## 2026-08-13 - 3.6.0
|
|
4
22
|
|
|
5
23
|
### Features
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@modelprofile.com/flexharness',
|
|
6
|
-
version: '3.
|
|
6
|
+
version: '3.8.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 { IFlexBackgroundExecution, IFlexCreateSessionOptions, IFlexEventArchiveMetadata, IFlexHarnessOptions, IFlexMessage, IFlexMessagePage, IFlexMessagePageOptions, IFlexPermissionRequest, IFlexPromptAdmission, IFlexPromptQueueAdmission, IFlexPromptQueueEntry, IFlexPromptOptions, IFlexPromptResult, IFlexScheduledPromptAdmission, IFlexSchedulePromptOptions, IFlexSession, IFlexUncertainToolExecution, IFlexUpdateSessionOptions, IJsonObject, TFlexHarnessEventListener, TFlexPermissionDecision, TFlexPrompt, TFlexToolExecutionReconciliation } from './interfaces.js';
|
|
1
|
+
import type { IFlexBackgroundExecution, IFlexCreateSessionOptions, IFlexEventArchiveMetadata, IFlexHarnessOptions, IFlexMessage, IFlexMessagePage, IFlexMessagePageOptions, IFlexPermissionRequest, IFlexPromptAdmission, IFlexPromptQueueAdmission, IFlexPromptQueueEntry, IFlexPromptOptions, IFlexPromptResult, IFlexRedoSessionResult, IFlexScheduledPromptAdmission, IFlexSchedulePromptOptions, IFlexSession, IFlexSessionReversionInfo, IFlexSlashCommandDescriptor, IFlexSlashCommandExecutionOptions, IFlexUncertainToolExecution, IFlexUndoSessionResult, IFlexUpdateSessionOptions, IJsonObject, TFlexHarnessEventListener, TFlexPermissionDecision, TFlexPrompt, TFlexSlashCommandExecutionResult, TFlexToolExecutionReconciliation } from './interfaces.js';
|
|
2
2
|
export declare function createFlexResourceToolNamespace(resourceId: string, attachmentRevision: number): string;
|
|
3
3
|
export declare function createFlexResourceToolName(namespace: string, toolName: string): string;
|
|
4
4
|
export declare class FlexHarness<TScope = unknown> {
|
|
@@ -12,8 +12,12 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
12
12
|
private readonly toolOutputLimits;
|
|
13
13
|
private readonly callbackLimits;
|
|
14
14
|
private readonly promptQueueLimits;
|
|
15
|
+
private readonly reversionLimits;
|
|
16
|
+
private readonly turnReversionProvider;
|
|
17
|
+
private readonly reversionPolicy;
|
|
15
18
|
private readonly externalErrorProjector?;
|
|
16
19
|
private readonly subagents;
|
|
20
|
+
private readonly slashCommands;
|
|
17
21
|
private readonly maxSubagentDepth;
|
|
18
22
|
private readonly maxSubagentCallsPerRun;
|
|
19
23
|
private readonly stateLoads;
|
|
@@ -28,8 +32,13 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
28
32
|
private readonly orphanedExecutionContexts;
|
|
29
33
|
private readonly orphanedProviderReleases;
|
|
30
34
|
private readonly orphanedTombstoneCleanups;
|
|
35
|
+
private readonly orphanedTombstoneOwners;
|
|
31
36
|
private readonly pendingPromptAdmissionOwners;
|
|
37
|
+
private readonly activeSlashCommandExecutions;
|
|
38
|
+
private readonly activeSlashCommandListings;
|
|
32
39
|
private readonly compactorInvocationContext;
|
|
40
|
+
private readonly slashCommandInvocationContext;
|
|
41
|
+
private readonly slashCommandActivityContext;
|
|
33
42
|
private readonly deferredCompactorContexts;
|
|
34
43
|
private sequence;
|
|
35
44
|
private promptQueueSequence;
|
|
@@ -41,12 +50,27 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
41
50
|
listSessions(scopeId: string): Promise<IFlexSession[]>;
|
|
42
51
|
createSession(scopeId: string, options?: IFlexCreateSessionOptions): Promise<IFlexSession>;
|
|
43
52
|
getSession(scopeId: string, sessionId: string): Promise<IFlexSession>;
|
|
53
|
+
getSessionReversionInfo(scopeId: string, sessionId: string): Promise<IFlexSessionReversionInfo>;
|
|
44
54
|
updateSession(scopeId: string, sessionId: string, options: IFlexUpdateSessionOptions): Promise<IFlexSession>;
|
|
45
55
|
deleteSession(scopeId: string, sessionId: string): Promise<void>;
|
|
46
56
|
private deleteSessionInternal;
|
|
47
57
|
getMessages(scopeId: string, sessionId: string): Promise<IFlexMessage[]>;
|
|
48
58
|
listMessagePage(scopeId: string, sessionId: string, options?: IFlexMessagePageOptions): Promise<IFlexMessagePage>;
|
|
49
59
|
getMessage(scopeId: string, sessionId: string, messageId: string): Promise<IFlexMessage>;
|
|
60
|
+
listSlashCommands(scopeId: string, sessionId: string): Promise<IFlexSlashCommandDescriptor[]>;
|
|
61
|
+
private createSlashCommandDescriptors;
|
|
62
|
+
executeSlashCommand(scopeId: string, sessionId: string, untouchedInput: string, options?: IFlexSlashCommandExecutionOptions): Promise<TFlexSlashCommandExecutionResult>;
|
|
63
|
+
private isSessionAvailableForSlashCommand;
|
|
64
|
+
private slashCommandPromptUnavailableReason;
|
|
65
|
+
private slashCommandPromptAvailability;
|
|
66
|
+
private requireSlashCommandPromptAvailable;
|
|
67
|
+
private promptAdmissionByteSize;
|
|
68
|
+
private isSessionRuntimeIdle;
|
|
69
|
+
private slashCommandSessionKey;
|
|
70
|
+
private requireSessionAvailableForSlashCommand;
|
|
71
|
+
private trackSlashCommandExecution;
|
|
72
|
+
private trackSlashCommandListing;
|
|
73
|
+
private executeSlashCommandHandler;
|
|
50
74
|
prompt(scopeId: string, sessionId: string, prompt: TFlexPrompt, options?: IFlexPromptOptions): Promise<IFlexPromptResult>;
|
|
51
75
|
startPrompt(scopeId: string, sessionId: string, prompt: TFlexPrompt, options?: IFlexPromptOptions): Promise<IFlexPromptAdmission>;
|
|
52
76
|
enqueuePrompt(scopeId: string, sessionId: string, prompt: TFlexPrompt, options?: IFlexPromptOptions): Promise<IFlexPromptQueueAdmission>;
|
|
@@ -64,6 +88,20 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
64
88
|
type: string;
|
|
65
89
|
}): Promise<void>;
|
|
66
90
|
compactSession(scopeId: string, sessionId: string): Promise<void>;
|
|
91
|
+
private compactStoredSession;
|
|
92
|
+
undoSession(scopeId: string, sessionId: string, signal?: AbortSignal): Promise<IFlexUndoSessionResult>;
|
|
93
|
+
redoSession(scopeId: string, sessionId: string, signal?: AbortSignal): Promise<IFlexRedoSessionResult>;
|
|
94
|
+
private reversionUnit;
|
|
95
|
+
private reversionGroups;
|
|
96
|
+
private requireReversionIdle;
|
|
97
|
+
private reversionUnavailableReason;
|
|
98
|
+
private awaitReversionOperation;
|
|
99
|
+
private changeReversionCursor;
|
|
100
|
+
private changeReversionCursorResolved;
|
|
101
|
+
private reconcileContextAvailability;
|
|
102
|
+
private resumePendingApply;
|
|
103
|
+
private persistKnownNotApplied;
|
|
104
|
+
private recoverPendingCapture;
|
|
67
105
|
archiveSessionEvents(scopeId: string, sessionId: string, compactionEventId?: string): Promise<IFlexEventArchiveMetadata | undefined>;
|
|
68
106
|
listBackgroundExecutions(scopeId: string, sessionId: string): Promise<IFlexBackgroundExecution[]>;
|
|
69
107
|
getBackgroundExecution(scopeId: string, sessionId: string, executionId: string): Promise<IFlexBackgroundExecution>;
|
|
@@ -96,6 +134,29 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
96
134
|
private abortExactRun;
|
|
97
135
|
private createReservation;
|
|
98
136
|
private buildTerminal;
|
|
137
|
+
private reversionId;
|
|
138
|
+
private reversionProviderProtocolVersion;
|
|
139
|
+
private reversionCaptureContext;
|
|
140
|
+
private withReversionMaintenanceSignal;
|
|
141
|
+
private inspectReversionCapture;
|
|
142
|
+
private finalizeReversionCapture;
|
|
143
|
+
private resolveReversionCaptureOutcome;
|
|
144
|
+
private normalizeReversionReference;
|
|
145
|
+
private normalizeReversionOutcome;
|
|
146
|
+
private normalizeAffectedWorkspaces;
|
|
147
|
+
private prepareRunReversion;
|
|
148
|
+
private finalizeRunReversion;
|
|
149
|
+
private applyFinalizedReversionOutcome;
|
|
150
|
+
private hiddenReversionSegments;
|
|
151
|
+
private enqueueReversionRelease;
|
|
152
|
+
private enqueueReversionReleaseReference;
|
|
153
|
+
private pruneReversionState;
|
|
154
|
+
private commitRevertedBranch;
|
|
155
|
+
private commitRevertedBranchState;
|
|
156
|
+
private commitArchivedHiddenBranchState;
|
|
157
|
+
private filterReversionContextEvents;
|
|
158
|
+
private drainReversionReleases;
|
|
159
|
+
private releaseDeletedSessionReversions;
|
|
99
160
|
private promoteCompletedTerminal;
|
|
100
161
|
private publishFailedTerminal;
|
|
101
162
|
private replaceStagedTerminal;
|
|
@@ -146,6 +207,8 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
146
207
|
private mutatePermissions;
|
|
147
208
|
private createScopeSnapshot;
|
|
148
209
|
private createProjectionSnapshot;
|
|
210
|
+
private upgradeProjectionSnapshot;
|
|
211
|
+
private reconcileProjectionFromStore;
|
|
149
212
|
private cleanupSessionDomains;
|
|
150
213
|
private collectSessionSubtree;
|
|
151
214
|
private tombstoneGroup;
|
|
@@ -155,6 +218,7 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
155
218
|
private finishTombstoneCleanupInternal;
|
|
156
219
|
private fenceNamespace;
|
|
157
220
|
private deferNamespaceDrain;
|
|
221
|
+
private deferReversionReleaseDrain;
|
|
158
222
|
private sessionsAreDependencyRelated;
|
|
159
223
|
private isSessionAncestor;
|
|
160
224
|
private sessionAncestryDepth;
|
|
@@ -174,12 +238,16 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
174
238
|
private drainStorage;
|
|
175
239
|
private drainStorageInternal;
|
|
176
240
|
private disposeInternal;
|
|
241
|
+
private abortSlashCommandExecutions;
|
|
242
|
+
private abortSlashCommandListings;
|
|
177
243
|
private appendUnexpectedErrors;
|
|
178
244
|
private abortCompactorLifecycle;
|
|
179
245
|
private resolveState;
|
|
180
246
|
private getScopeAdmission;
|
|
181
247
|
private pruneScopeAdmission;
|
|
182
248
|
private createScopeRetirementError;
|
|
249
|
+
private ambientSlashCommandOwner;
|
|
250
|
+
private assertNoAmbientSlashCommandTeardown;
|
|
183
251
|
private assertStateAcceptingWork;
|
|
184
252
|
private createCompactorContext;
|
|
185
253
|
private withCompactorContext;
|
|
@@ -187,6 +255,8 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
187
255
|
private effectiveRunCompactorContext;
|
|
188
256
|
private withRunCompactorContext;
|
|
189
257
|
private requireSession;
|
|
258
|
+
private completedReversionCandidates;
|
|
259
|
+
private visibleMessages;
|
|
190
260
|
private requireMutableSession;
|
|
191
261
|
private requireMessage;
|
|
192
262
|
private isTombstoned;
|