@modelprofile.com/flexharness 9.3.1 → 9.5.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/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.flexharness.d.ts +39 -2
- package/dist_ts/classes.flexharness.js +451 -30
- package/dist_ts/errors.d.ts +5 -0
- package/dist_ts/errors.js +10 -1
- package/dist_ts/interfaces.d.ts +128 -0
- package/dist_ts/interfaces.js +19 -1
- package/dist_ts/utils.json.d.ts +5 -0
- package/dist_ts/utils.json.js +34 -1
- package/dist_ts/utils.sessionimport.d.ts +26 -0
- package/dist_ts/utils.sessionimport.js +241 -0
- package/dist_ts/utils.validation.d.ts +2 -1
- package/dist_ts/utils.validation.js +14 -1
- package/package.json +3 -3
- package/readme.md +107 -2
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.flexharness.ts +557 -25
- package/ts/errors.ts +11 -0
- package/ts/interfaces.ts +146 -1
- package/ts/readme.md +107 -2
- package/ts/utils.json.ts +37 -0
- package/ts/utils.sessionimport.ts +327 -0
- package/ts/utils.validation.ts +16 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@modelprofile.com/flexharness',
|
|
6
|
-
version: '9.
|
|
6
|
+
version: '9.5.0',
|
|
7
7
|
description: 'The FlexHarness toolbox source repository and shared dependency catalog.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSwrQkFBK0I7SUFDckMsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLDBFQUEwRTtDQUN4RixDQUFBIn0=
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IFlexBackgroundExecution, IFlexCreateProjectTaskInput, IFlexCreateSessionOptions, IFlexDeleteSessionGenerationCohortInput, IFlexDeleteSessionGenerationCohortResult, IFlexEventArchiveMetadata, IFlexHarnessOptions, IFlexMessage, IFlexMessagePage, IFlexMessagePageOptions, IFlexPermissionRequest, IFlexProjectGoalResult, IFlexProjectScratchpadResult, IFlexProjectStateResult, IFlexProjectTaskResult, IFlexProjectTasksResult, IFlexPromptAdmission, IFlexPromptQueueAdmission, IFlexPromptQueueEntry, IFlexPromptOptions, IFlexPromptResult, IFlexRedoSessionResult, IFlexScheduledPromptAdmission, IFlexSchedulePromptOptions, IFlexSession, IFlexSessionReversionInfo, IFlexSlashCommandDescriptor, IFlexSlashCommandExecutionOptions, IFlexUncertainToolExecution, IFlexUndoSessionResult, IFlexUpdateSessionOptions, IFlexUpdateProjectTaskInput, IJsonObject, TFlexHarnessEventListener, TFlexPermissionDecision, TFlexPrompt, TFlexSlashCommandExecutionResult, TFlexToolExecutionReconciliation } from './interfaces.js';
|
|
1
|
+
import type { IFlexBackgroundExecution, IFlexBeginSessionImportOptions, IFlexCompactSessionOptions, IFlexCreateProjectTaskInput, IFlexCreateSessionOptions, IFlexDeleteSessionGenerationCohortInput, IFlexDeleteSessionGenerationCohortResult, IFlexEventArchiveMetadata, IFlexHarnessOptions, IFlexImportedRun, IFlexMessage, IFlexMessagePage, IFlexMessagePageOptions, IFlexPermissionRequest, IFlexProjectGoalResult, IFlexProjectScratchpadResult, IFlexProjectStateResult, IFlexProjectTaskResult, IFlexProjectTasksResult, IFlexPromptAdmission, IFlexPromptQueueAdmission, IFlexPromptQueueEntry, IFlexPromptOptions, IFlexPromptResult, IFlexRedoSessionResult, IFlexScheduledPromptAdmission, IFlexSchedulePromptOptions, IFlexSession, IFlexSessionImportHandle, IFlexSessionImportProgress, IFlexSessionReversionInfo, IFlexSlashCommandDescriptor, IFlexSlashCommandExecutionOptions, IFlexUncertainToolExecution, IFlexUndoSessionResult, IFlexUpdateSessionOptions, IFlexUpdateProjectTaskInput, IJsonObject, TFlexBeginSessionImportResult, 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> {
|
|
@@ -14,6 +14,7 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
14
14
|
private readonly callbackLimits;
|
|
15
15
|
private readonly promptQueueLimits;
|
|
16
16
|
private readonly reversionLimits;
|
|
17
|
+
private readonly sessionImportLimits;
|
|
17
18
|
private readonly reversionMaintenanceTimeoutMs;
|
|
18
19
|
private readonly turnReversionProvider;
|
|
19
20
|
private readonly reversionPolicy;
|
|
@@ -40,6 +41,7 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
40
41
|
private readonly projectManagementQueues;
|
|
41
42
|
private readonly activeSlashCommandExecutions;
|
|
42
43
|
private readonly activeSlashCommandListings;
|
|
44
|
+
private readonly stagedSessionImports;
|
|
43
45
|
private readonly compactorInvocationContext;
|
|
44
46
|
private readonly slashCommandInvocationContext;
|
|
45
47
|
private readonly slashCommandActivityContext;
|
|
@@ -53,6 +55,21 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
53
55
|
constructor(options: IFlexHarnessOptions<TScope>);
|
|
54
56
|
listSessions(scopeId: string): Promise<IFlexSession[]>;
|
|
55
57
|
createSession(scopeId: string, options?: IFlexCreateSessionOptions): Promise<IFlexSession>;
|
|
58
|
+
/**
|
|
59
|
+
* Starts a staged import of a finished conversation into a new read-only session. The session
|
|
60
|
+
* stays hidden until `commitSessionImport()`. A committed session with the same source, source
|
|
61
|
+
* id and part is reported instead of being imported twice.
|
|
62
|
+
*/
|
|
63
|
+
beginSessionImport(scopeId: string, options: IFlexBeginSessionImportOptions): Promise<TFlexBeginSessionImportResult>;
|
|
64
|
+
/** Stages one page of runs, in order, for a started session import. A rejected page stages nothing. */
|
|
65
|
+
appendImportedRuns(handle: IFlexSessionImportHandle, runs: readonly IFlexImportedRun[]): Promise<IFlexSessionImportProgress>;
|
|
66
|
+
/**
|
|
67
|
+
* Persists the staged runs and publishes the session: archived, read-only and marked with its
|
|
68
|
+
* `origin`. A failed commit removes everything it persisted before it rejects.
|
|
69
|
+
*/
|
|
70
|
+
commitSessionImport(handle: IFlexSessionImportHandle): Promise<IFlexSession>;
|
|
71
|
+
/** Discards a staged import. Nothing of it was persisted; an unknown or finished handle is ignored. */
|
|
72
|
+
abortSessionImport(handle: IFlexSessionImportHandle): Promise<void>;
|
|
56
73
|
getSession(scopeId: string, sessionId: string): Promise<IFlexSession>;
|
|
57
74
|
getSessionReversionInfo(scopeId: string, sessionId: string): Promise<IFlexSessionReversionInfo>;
|
|
58
75
|
updateSession(scopeId: string, sessionId: string, options: IFlexUpdateSessionOptions): Promise<IFlexSession>;
|
|
@@ -111,7 +128,7 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
111
128
|
pushRuntimeEvent(scopeId: string, sessionId: string, event: IJsonObject & {
|
|
112
129
|
type: string;
|
|
113
130
|
}): Promise<void>;
|
|
114
|
-
compactSession(scopeId: string, sessionId: string): Promise<void>;
|
|
131
|
+
compactSession(scopeId: string, sessionId: string, options?: IFlexCompactSessionOptions): Promise<void>;
|
|
115
132
|
private compactStoredSession;
|
|
116
133
|
undoSession(scopeId: string, sessionId: string, signal?: AbortSignal): Promise<IFlexUndoSessionResult>;
|
|
117
134
|
redoSession(scopeId: string, sessionId: string, signal?: AbortSignal): Promise<IFlexRedoSessionResult>;
|
|
@@ -337,6 +354,11 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
337
354
|
private assertNoAmbientSlashCommandTeardown;
|
|
338
355
|
private assertStateAcceptingWork;
|
|
339
356
|
private createCompactorContext;
|
|
357
|
+
/**
|
|
358
|
+
* The model the compacted work was dispatched on: the resolved model of the run whose context
|
|
359
|
+
* overflowed, or the model hint a manual compaction was requested with. Retention states none.
|
|
360
|
+
*/
|
|
361
|
+
private compactionModel;
|
|
340
362
|
private withCompactorContext;
|
|
341
363
|
private createRunCompactorContext;
|
|
342
364
|
private effectiveRunCompactorContext;
|
|
@@ -345,6 +367,21 @@ export declare class FlexHarness<TScope = unknown> {
|
|
|
345
367
|
private completedReversionCandidates;
|
|
346
368
|
private visibleMessages;
|
|
347
369
|
private requireMutableSession;
|
|
370
|
+
/** Refuses an operation that would change an imported session's history or model context. */
|
|
371
|
+
private assertSessionWritable;
|
|
372
|
+
/** An imported session never ran here, so it has no hidden stage and no reversion state. */
|
|
373
|
+
private assertImportedSessionState;
|
|
374
|
+
private assertNoCommittingSessionImport;
|
|
375
|
+
private findStagedSessionImport;
|
|
376
|
+
private requireStagedSessionImport;
|
|
377
|
+
private armStagedImportIdleTimer;
|
|
378
|
+
private clearStagedImportIdleTimer;
|
|
379
|
+
private releaseStagedSessionImport;
|
|
380
|
+
/**
|
|
381
|
+
* An imported child session belongs to a committed imported parent whose run `parent.runId` holds
|
|
382
|
+
* the tool call `parent.toolCallId` naming the child, and no other session claims that tool call.
|
|
383
|
+
*/
|
|
384
|
+
private requireImportParent;
|
|
348
385
|
private requireMessage;
|
|
349
386
|
private isTombstoned;
|
|
350
387
|
private emitPartEvent;
|