@modelprofile.com/flexharness-agent 6.0.0 → 6.1.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.
Files changed (40) hide show
  1. package/dist_ts_agent/classes.sessionengine.d.ts +93 -0
  2. package/dist_ts_agent/classes.sessionengine.js +2140 -0
  3. package/dist_ts_agent/index.d.ts +3 -2
  4. package/dist_ts_agent/index.js +3 -2
  5. package/dist_ts_agent/persistence.file.d.ts +24 -0
  6. package/dist_ts_agent/persistence.file.js +199 -0
  7. package/dist_ts_agent/plugins.d.ts +0 -7
  8. package/dist_ts_agent/plugins.js +1 -9
  9. package/dist_ts_agent/plugins.node.d.ts +7 -0
  10. package/dist_ts_agent/plugins.node.js +9 -0
  11. package/dist_ts_agent/plugins.portable.d.ts +4 -0
  12. package/dist_ts_agent/plugins.portable.js +5 -0
  13. package/dist_ts_agent/runner.d.ts +4 -0
  14. package/dist_ts_agent/runner.js +34 -0
  15. package/dist_ts_agent/runtime.interfaces.d.ts +21 -0
  16. package/dist_ts_agent/runtime.interfaces.js +2 -0
  17. package/dist_ts_agent/runtime.run.d.ts +3 -0
  18. package/dist_ts_agent/runtime.run.js +94 -0
  19. package/dist_ts_agent/smartagent.classes.agent.js +4 -93
  20. package/dist_ts_agent/smartagent.classes.session.d.ts +5 -88
  21. package/dist_ts_agent/smartagent.classes.session.js +19 -2134
  22. package/dist_ts_agent/smartagent.events.js +2 -2
  23. package/dist_ts_agent/smartagent.persistence.d.ts +2 -22
  24. package/dist_ts_agent/smartagent.persistence.js +3 -198
  25. package/package.json +9 -3
  26. package/readme.md +6 -0
  27. package/ts_agent/classes.sessionengine.ts +2591 -0
  28. package/ts_agent/index.ts +2 -2
  29. package/ts_agent/persistence.file.ts +232 -0
  30. package/ts_agent/plugins.node.ts +10 -0
  31. package/ts_agent/plugins.portable.ts +5 -0
  32. package/ts_agent/plugins.ts +0 -10
  33. package/ts_agent/readme.md +6 -0
  34. package/ts_agent/runner.ts +40 -0
  35. package/ts_agent/runtime.interfaces.ts +21 -0
  36. package/ts_agent/runtime.run.ts +107 -0
  37. package/ts_agent/smartagent.classes.agent.ts +4 -101
  38. package/ts_agent/smartagent.classes.session.ts +24 -2582
  39. package/ts_agent/smartagent.events.ts +1 -1
  40. package/ts_agent/smartagent.persistence.ts +2 -224
@@ -0,0 +1,93 @@
1
+ import * as plugins from './plugins.js';
2
+ import type { IAgentRuntimePlatform, TAgentSessionOwnership } from './runtime.interfaces.js';
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 IAgentSession, type IAgentSessionAbortOptions, type IAgentSessionOptions, type IAgentScheduleGenerateOptions, type TAgentSessionChangeListener, type TAgentPrompt, type TAgentToolExecutionReconciliationOptions } from './smartagent.interfaces.js';
5
+ import type { TAgentEventArchive } from './smartagent.persistence.js';
6
+ export declare class AgentSessionEngine implements IAgentSession {
7
+ private readonly platform;
8
+ private readonly ownership;
9
+ private readonly options;
10
+ private readonly events;
11
+ private readonly eventIds;
12
+ private readonly generationHandles;
13
+ private readonly unresolvedLeaseCleanups;
14
+ private sequence;
15
+ private persistenceRevision;
16
+ private persistenceQueue;
17
+ private persistenceError;
18
+ private readonly notificationDispatches;
19
+ private readonly listeners;
20
+ private readonly scheduledGenerations;
21
+ private retentionPromise;
22
+ private maintenanceError;
23
+ private generationQueue;
24
+ private currentGenerationAbortController;
25
+ private readonly sessionAbortController;
26
+ private jobUnsubscribe;
27
+ private closed;
28
+ private closeFinalizationReached;
29
+ private closeCleanupCompletedState;
30
+ get closeCleanupCompleted(): boolean;
31
+ private refreshCloseCleanupCompleted;
32
+ protected static createWithFactory<TSession extends AgentSessionEngine>(options: IAgentSessionOptions, create: () => TSession): Promise<TSession>;
33
+ protected constructor(options: IAgentSessionOptions, platform: IAgentRuntimePlatform, ownership: TAgentSessionOwnership);
34
+ private attachJobSubscription;
35
+ private restoreEvent;
36
+ private queuePersistence;
37
+ private flushPersistence;
38
+ private reportListenerError;
39
+ private queueNotification;
40
+ private enqueueListenerChange;
41
+ private deliverListenerChanges;
42
+ private commitEvents;
43
+ private commitEvent;
44
+ pushEvent(event: TAgentEvent): Promise<void>;
45
+ pushUserMessage(content: TAgentPrompt): Promise<void>;
46
+ pushRuntimeEvent(event: import('./smartagent.events.js').IAgentRuntimeEventPayload): Promise<void>;
47
+ private transaction;
48
+ private archivedTransaction;
49
+ private verifyGenerationClaim;
50
+ private interruptRestoredTransactions;
51
+ private transactionalStoreCapabilityError;
52
+ beginGeneration(content: TAgentPrompt, options?: IAgentBeginGenerationOptions): Promise<IAgentGenerationHandle>;
53
+ private appendGenerationOutcome;
54
+ private transactionOutcomeErrorReason;
55
+ finalizeGeneration(transaction: IAgentGenerationHandle, outcome: TAgentGenerationOutcome): Promise<void>;
56
+ listUncertainToolExecutions(): IToolExecutionIntentEvent[];
57
+ reconcileToolExecution(intentId: string, reconciliation: TAgentToolExecutionReconciliationOptions): Promise<void>;
58
+ getEvents(): readonly TAgentEvent[];
59
+ getModelMessages(): plugins.ModelMessage[];
60
+ private buildContext;
61
+ subscribe(listener: TAgentSessionChangeListener): () => void;
62
+ scheduleGenerate(options: IAgentScheduleGenerateOptions): Promise<IAgentGenerateResult>;
63
+ private startScheduledGeneration;
64
+ private settleScheduledGeneration;
65
+ cancelScheduledGeneration(key: string, reason?: unknown): boolean;
66
+ private performCompaction;
67
+ private queueExclusive;
68
+ compact(options?: IAgentCompactOptions): Promise<void>;
69
+ archiveCompactedEvents(compactionEventId?: string): Promise<TAgentEventArchive | undefined>;
70
+ private archiveCompactedEventsLocked;
71
+ private runEventRetentionLocked;
72
+ private scheduleEventRetention;
73
+ private eventsByIds;
74
+ private currentGenerationEvent;
75
+ private reconcileToolResult;
76
+ private commitResponseMessages;
77
+ private wrapToolsForGeneration;
78
+ private trackToolExecutionIterable;
79
+ private ownGenerationLeaseCleanup;
80
+ private cleanupGenerationLease;
81
+ generate(options?: IAgentGenerateOptions): Promise<IAgentGenerateResult>;
82
+ private resolveEffectiveGenerationRuntime;
83
+ private generateLocked;
84
+ abortCurrentGeneration(reason?: unknown): void;
85
+ abortSession(reason?: unknown, options?: IAgentSessionAbortOptions): Promise<void>;
86
+ getBackgroundExecution(executionId: string): Promise<plugins.IToolJobState>;
87
+ abortBackgroundExecution(executionId: string): Promise<void>;
88
+ close(): Promise<void>;
89
+ private runInCallbackScope;
90
+ private invokeGenerationCallback;
91
+ private adoptGenerationCallbackResult;
92
+ private wrapGenerationCallbackIterable;
93
+ }