@modelprofile.com/flexharness 3.6.0 → 3.7.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 +9 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.flexharness.d.ts +59 -1
- package/dist_ts/classes.flexharness.js +1805 -37
- 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 +188 -5
- package/dist_ts/interfaces.js +14 -2
- package/dist_ts/plugins.d.ts +2 -2
- package/dist_ts/plugins.js +3 -3
- package/dist_ts/utils.json.d.ts +4 -2
- package/dist_ts/utils.json.js +253 -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 +3 -0
- package/readme.md +114 -3
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.flexharness.ts +2706 -245
- package/ts/classes.stores.ts +9 -8
- package/ts/errors.ts +25 -0
- package/ts/index.ts +4 -0
- package/ts/interfaces.ts +259 -5
- package/ts/plugins.ts +2 -0
- package/ts/utils.json.ts +284 -12
- package/ts/utils.slashcommands.ts +178 -0
- package/ts_migration/v3_legacyflexharness.ts +10 -5
package/changelog.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-08-13 - 3.7.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add native slash commands and turn reversion (harness)
|
|
8
|
+
- Add built-in, template, and typed-handler slash commands with authoritative parsing, availability, execution, and literal unknown-command fallback.
|
|
9
|
+
- Add durable grouped undo and redo with optional workspace capture, crash recovery, branch commitment, release ownership, and archival horizons.
|
|
10
|
+
- Upgrade projection persistence to schema version 2 while preserving version 1 loading, and document the public command and reversion contracts.
|
|
11
|
+
|
|
3
12
|
## 2026-08-13 - 3.6.0
|
|
4
13
|
|
|
5
14
|
### Features
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@modelprofile.com/flexharness',
|
|
6
|
-
version: '3.
|
|
6
|
+
version: '3.7.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, 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,11 @@ 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;
|
|
15
17
|
private readonly externalErrorProjector?;
|
|
16
18
|
private readonly subagents;
|
|
19
|
+
private readonly slashCommands;
|
|
17
20
|
private readonly maxSubagentDepth;
|
|
18
21
|
private readonly maxSubagentCallsPerRun;
|
|
19
22
|
private readonly stateLoads;
|
|
@@ -28,8 +31,12 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
28
31
|
private readonly orphanedExecutionContexts;
|
|
29
32
|
private readonly orphanedProviderReleases;
|
|
30
33
|
private readonly orphanedTombstoneCleanups;
|
|
34
|
+
private readonly orphanedTombstoneOwners;
|
|
31
35
|
private readonly pendingPromptAdmissionOwners;
|
|
36
|
+
private readonly activeSlashCommandExecutions;
|
|
37
|
+
private readonly activeSlashCommandListings;
|
|
32
38
|
private readonly compactorInvocationContext;
|
|
39
|
+
private readonly slashCommandInvocationContext;
|
|
33
40
|
private readonly deferredCompactorContexts;
|
|
34
41
|
private sequence;
|
|
35
42
|
private promptQueueSequence;
|
|
@@ -47,6 +54,20 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
47
54
|
getMessages(scopeId: string, sessionId: string): Promise<IFlexMessage[]>;
|
|
48
55
|
listMessagePage(scopeId: string, sessionId: string, options?: IFlexMessagePageOptions): Promise<IFlexMessagePage>;
|
|
49
56
|
getMessage(scopeId: string, sessionId: string, messageId: string): Promise<IFlexMessage>;
|
|
57
|
+
listSlashCommands(scopeId: string, sessionId: string): Promise<IFlexSlashCommandDescriptor[]>;
|
|
58
|
+
private createSlashCommandDescriptors;
|
|
59
|
+
executeSlashCommand(scopeId: string, sessionId: string, untouchedInput: string, options?: IFlexSlashCommandExecutionOptions): Promise<TFlexSlashCommandExecutionResult>;
|
|
60
|
+
private isSessionAvailableForSlashCommand;
|
|
61
|
+
private slashCommandPromptUnavailableReason;
|
|
62
|
+
private slashCommandPromptAvailability;
|
|
63
|
+
private requireSlashCommandPromptAvailable;
|
|
64
|
+
private promptAdmissionByteSize;
|
|
65
|
+
private isSessionRuntimeIdle;
|
|
66
|
+
private slashCommandSessionKey;
|
|
67
|
+
private requireSessionAvailableForSlashCommand;
|
|
68
|
+
private trackSlashCommandExecution;
|
|
69
|
+
private trackSlashCommandListing;
|
|
70
|
+
private executeSlashCommandHandler;
|
|
50
71
|
prompt(scopeId: string, sessionId: string, prompt: TFlexPrompt, options?: IFlexPromptOptions): Promise<IFlexPromptResult>;
|
|
51
72
|
startPrompt(scopeId: string, sessionId: string, prompt: TFlexPrompt, options?: IFlexPromptOptions): Promise<IFlexPromptAdmission>;
|
|
52
73
|
enqueuePrompt(scopeId: string, sessionId: string, prompt: TFlexPrompt, options?: IFlexPromptOptions): Promise<IFlexPromptQueueAdmission>;
|
|
@@ -64,6 +85,19 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
64
85
|
type: string;
|
|
65
86
|
}): Promise<void>;
|
|
66
87
|
compactSession(scopeId: string, sessionId: string): Promise<void>;
|
|
88
|
+
private compactStoredSession;
|
|
89
|
+
undoSession(scopeId: string, sessionId: string, signal?: AbortSignal): Promise<IFlexUndoSessionResult>;
|
|
90
|
+
redoSession(scopeId: string, sessionId: string, signal?: AbortSignal): Promise<IFlexRedoSessionResult>;
|
|
91
|
+
private reversionUnit;
|
|
92
|
+
private requireReversionIdle;
|
|
93
|
+
private reversionUnavailableReason;
|
|
94
|
+
private awaitReversionOperation;
|
|
95
|
+
private changeReversionCursor;
|
|
96
|
+
private changeReversionCursorResolved;
|
|
97
|
+
private reconcileContextAvailability;
|
|
98
|
+
private resumePendingApply;
|
|
99
|
+
private persistKnownNotApplied;
|
|
100
|
+
private recoverPendingCapture;
|
|
67
101
|
archiveSessionEvents(scopeId: string, sessionId: string, compactionEventId?: string): Promise<IFlexEventArchiveMetadata | undefined>;
|
|
68
102
|
listBackgroundExecutions(scopeId: string, sessionId: string): Promise<IFlexBackgroundExecution[]>;
|
|
69
103
|
getBackgroundExecution(scopeId: string, sessionId: string, executionId: string): Promise<IFlexBackgroundExecution>;
|
|
@@ -96,6 +130,24 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
96
130
|
private abortExactRun;
|
|
97
131
|
private createReservation;
|
|
98
132
|
private buildTerminal;
|
|
133
|
+
private reversionId;
|
|
134
|
+
private reversionCaptureContext;
|
|
135
|
+
private withReversionMaintenanceSignal;
|
|
136
|
+
private inspectReversionCapture;
|
|
137
|
+
private finalizeReversionCapture;
|
|
138
|
+
private resolveReversionCaptureReference;
|
|
139
|
+
private normalizeReversionReference;
|
|
140
|
+
private prepareRunReversion;
|
|
141
|
+
private finalizeRunReversion;
|
|
142
|
+
private hiddenReversionSegments;
|
|
143
|
+
private enqueueReversionRelease;
|
|
144
|
+
private pruneReversionState;
|
|
145
|
+
private commitRevertedBranch;
|
|
146
|
+
private commitRevertedBranchState;
|
|
147
|
+
private commitArchivedHiddenBranchState;
|
|
148
|
+
private filterReversionContextEvents;
|
|
149
|
+
private drainReversionReleases;
|
|
150
|
+
private releaseDeletedSessionReversions;
|
|
99
151
|
private promoteCompletedTerminal;
|
|
100
152
|
private publishFailedTerminal;
|
|
101
153
|
private replaceStagedTerminal;
|
|
@@ -146,6 +198,7 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
146
198
|
private mutatePermissions;
|
|
147
199
|
private createScopeSnapshot;
|
|
148
200
|
private createProjectionSnapshot;
|
|
201
|
+
private reconcileProjectionFromStore;
|
|
149
202
|
private cleanupSessionDomains;
|
|
150
203
|
private collectSessionSubtree;
|
|
151
204
|
private tombstoneGroup;
|
|
@@ -155,6 +208,7 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
155
208
|
private finishTombstoneCleanupInternal;
|
|
156
209
|
private fenceNamespace;
|
|
157
210
|
private deferNamespaceDrain;
|
|
211
|
+
private deferReversionReleaseDrain;
|
|
158
212
|
private sessionsAreDependencyRelated;
|
|
159
213
|
private isSessionAncestor;
|
|
160
214
|
private sessionAncestryDepth;
|
|
@@ -174,6 +228,8 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
174
228
|
private drainStorage;
|
|
175
229
|
private drainStorageInternal;
|
|
176
230
|
private disposeInternal;
|
|
231
|
+
private abortSlashCommandExecutions;
|
|
232
|
+
private abortSlashCommandListings;
|
|
177
233
|
private appendUnexpectedErrors;
|
|
178
234
|
private abortCompactorLifecycle;
|
|
179
235
|
private resolveState;
|
|
@@ -187,6 +243,8 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
187
243
|
private effectiveRunCompactorContext;
|
|
188
244
|
private withRunCompactorContext;
|
|
189
245
|
private requireSession;
|
|
246
|
+
private completedReversionCandidates;
|
|
247
|
+
private visibleMessages;
|
|
190
248
|
private requireMutableSession;
|
|
191
249
|
private requireMessage;
|
|
192
250
|
private isTombstoned;
|