@modelprofile.com/flexharness 3.3.0 → 3.4.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 +10 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.flexharness.d.ts +11 -0
- package/dist_ts/classes.flexharness.js +284 -108
- package/dist_ts/interfaces.d.ts +12 -3
- package/dist_ts/plugins.d.ts +3 -2
- package/dist_ts/plugins.js +3 -2
- package/package.json +1 -1
- package/readme.hints.md +1 -0
- package/readme.md +2 -2
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.flexharness.ts +466 -98
- package/ts/interfaces.ts +19 -3
- package/ts/plugins.ts +3 -1
package/ts/interfaces.ts
CHANGED
|
@@ -441,9 +441,25 @@ export interface IFlexExecutionContextProvider<TScope> {
|
|
|
441
441
|
): Promise<IFlexExecutionContextHandle | undefined> | IFlexExecutionContextHandle | undefined;
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
-
export interface
|
|
444
|
+
export interface IFlexAgentContextInvocation<TScope = unknown> {
|
|
445
|
+
readonly scopeId: string;
|
|
446
|
+
readonly scope: TScope;
|
|
447
|
+
readonly storageKey: string;
|
|
448
|
+
readonly sessionId: string;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export interface IFlexAgentContextCompactionOptions<TScope = unknown>
|
|
452
|
+
extends plugins.IAgentContextCompactionOptions, IFlexAgentContextInvocation<TScope> {}
|
|
453
|
+
|
|
454
|
+
export type TFlexAgentContextCompactor<TScope = unknown> = (
|
|
455
|
+
messages: Parameters<plugins.TAgentContextCompactor>[0],
|
|
456
|
+
events: Parameters<plugins.TAgentContextCompactor>[1],
|
|
457
|
+
options: IFlexAgentContextCompactionOptions<TScope>,
|
|
458
|
+
) => ReturnType<plugins.TAgentContextCompactor>;
|
|
459
|
+
|
|
460
|
+
export interface IFlexAgentSessionPolicy<TScope = unknown> {
|
|
445
461
|
contextBuilder?: plugins.TAgentContextBuilder;
|
|
446
|
-
contextCompactor?:
|
|
462
|
+
contextCompactor?: TFlexAgentContextCompactor<TScope>;
|
|
447
463
|
eventRetention?: TFlexAgentSessionOptions['eventRetention'];
|
|
448
464
|
changeListenerTimeoutMs?: number;
|
|
449
465
|
maxPendingSessionChanges?: number;
|
|
@@ -458,7 +474,7 @@ export interface IFlexHarnessOptions<TScope> {
|
|
|
458
474
|
toolProvider?: IFlexToolProvider<TScope>;
|
|
459
475
|
executionContextProvider?: IFlexExecutionContextProvider<TScope>;
|
|
460
476
|
stores?: IFlexHarnessStores;
|
|
461
|
-
agentSessionPolicy?: IFlexAgentSessionPolicy
|
|
477
|
+
agentSessionPolicy?: IFlexAgentSessionPolicy<TScope>;
|
|
462
478
|
toolOutputLimits?: IFlexJsonLimits;
|
|
463
479
|
callbackLimits?: IFlexCallbackLimits;
|
|
464
480
|
promptQueueLimits?: IFlexPromptQueueLimits;
|
package/ts/plugins.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// node native scope
|
|
2
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
3
|
import * as crypto from 'node:crypto';
|
|
3
4
|
import * as fs from 'node:fs/promises';
|
|
4
5
|
import * as path from 'node:path';
|
|
5
6
|
|
|
6
|
-
export { crypto, fs, path };
|
|
7
|
+
export { AsyncLocalStorage, crypto, fs, path };
|
|
7
8
|
|
|
8
9
|
// @push.rocks scope
|
|
9
10
|
import {
|
|
@@ -31,6 +32,7 @@ export {
|
|
|
31
32
|
};
|
|
32
33
|
export type {
|
|
33
34
|
IAgentEventArchiveV2,
|
|
35
|
+
IAgentContextCompactionOptions,
|
|
34
36
|
IAgentEventSnapshotV2,
|
|
35
37
|
IAgentEventStoreV2,
|
|
36
38
|
IAgentGenerateResult,
|