@modelprofile.com/flexharness 9.4.0 → 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.
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@modelprofile.com/flexharness',
6
- version: '9.4.0',
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, IFlexCompactSessionOptions, 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>;
@@ -350,6 +367,21 @@ export declare class FlexHarness<TScope = unknown> {
350
367
  private completedReversionCandidates;
351
368
  private visibleMessages;
352
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;
353
385
  private requireMessage;
354
386
  private isTombstoned;
355
387
  private emitPartEvent;