@modelprofile.com/flexharness-agent 14.0.0 → 16.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.
@@ -1,15 +1,20 @@
1
1
  import * as plugins from './plugins.js';
2
2
  import type { IAgentRuntimePlatform, TAgentSessionOwnership } from './runtime.interfaces.js';
3
3
  import { type IToolExecutionIntentEvent, type TAgentEvent, type TAgentGenerationOutcome } from './smartagent.events.js';
4
- import { type IAgentGenerateOptions, type IAgentGenerateResult, type IAgentGenerationHandle, type IAgentCompactOptions, type IAgentBeginGenerationOptions, type IAgentFinalizeGenerationOptions, type IAgentSession, type IAgentSessionAbortOptions, type IAgentSessionOptions, type IAgentScheduleGenerateOptions, type TAgentSessionChangeListener, type TAgentPrompt, type TAgentToolExecutionReconciliationOptions } from './smartagent.interfaces.js';
4
+ import { type IAgentGenerateOptions, type IAgentGenerateResult, type IAgentGenerationHandle, type IAgentCompactOptions, type IAgentBeginGenerationOptions, type IAgentFinalizeGenerationOptions, type IAgentContinuationSession, type IAgentSessionAbortOptions, type IAgentSessionOptions, type IAgentScheduleGenerateOptions, type TAgentSessionChangeListener, type TAgentPrompt, type TAgentToolExecutionReconciliationOptions } from './smartagent.interfaces.js';
5
5
  import type { IAgentEventArchive } from './smartagent.persistence.js';
6
- export declare class AgentSessionEngine implements IAgentSession {
6
+ export declare class AgentSessionEngine implements IAgentContinuationSession {
7
7
  private readonly platform;
8
8
  private readonly ownership;
9
9
  private readonly options;
10
10
  private readonly events;
11
11
  private readonly eventIds;
12
12
  private readonly generationHandles;
13
+ /**
14
+ * The latest usage reading of each open transactional generation, written onto its outcome. It
15
+ * lives as long as the generation's handle: its outcome commit or the session's close ends both.
16
+ */
17
+ private readonly generationContextUsage;
13
18
  private readonly unresolvedLeaseCleanups;
14
19
  private sequence;
15
20
  private persistenceRevision;
@@ -61,6 +66,8 @@ export declare class AgentSessionEngine implements IAgentSession {
61
66
  private verifyGenerationClaim;
62
67
  private interruptRestoredTransactions;
63
68
  beginGeneration(content: TAgentPrompt, options?: IAgentBeginGenerationOptions): Promise<IAgentGenerationHandle>;
69
+ beginContinuation(options?: IAgentBeginGenerationOptions): Promise<IAgentGenerationHandle>;
70
+ private beginGenerationTransaction;
64
71
  private appendGenerationOutcome;
65
72
  private transactionOutcomeErrorReason;
66
73
  finalizeGeneration(transaction: IAgentGenerationHandle, outcome: TAgentGenerationOutcome, options?: IAgentFinalizeGenerationOptions): Promise<void>;
@@ -69,6 +76,13 @@ export declare class AgentSessionEngine implements IAgentSession {
69
76
  getEvents(): readonly TAgentEvent[];
70
77
  getModelMessages(): plugins.ModelMessage[];
71
78
  private buildContext;
79
+ /**
80
+ * The session's context in tokens. The latest provider usage reading counts while the events it
81
+ * saw still build the same model messages and no compaction followed them; what came after it
82
+ * is estimated. Without such a reading the whole context is estimated.
83
+ */
84
+ private measureContextTokens;
85
+ private latestContextUsage;
72
86
  subscribe(listener: TAgentSessionChangeListener): () => void;
73
87
  scheduleGenerate(options: IAgentScheduleGenerateOptions): Promise<IAgentGenerateResult>;
74
88
  private startScheduledGeneration;