@modelprofile.com/flexharness 3.7.0 → 3.8.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 +9 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.flexharness.d.ts +14 -2
- package/dist_ts/classes.flexharness.js +667 -199
- package/dist_ts/interfaces.d.ts +90 -6
- package/dist_ts/interfaces.js +5 -1
- package/dist_ts/utils.json.d.ts +3 -2
- package/dist_ts/utils.json.js +243 -11
- package/dist_ts_migration/v3_legacyflexharness.js +1 -1
- package/package.json +1 -1
- package/readme.hints.md +3 -2
- package/readme.md +86 -10
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.flexharness.ts +757 -198
- package/ts/classes.stores.ts +3 -3
- package/ts/interfaces.ts +125 -6
- package/ts/utils.json.ts +271 -12
- package/ts_migration/v3_legacyflexharness.ts +1 -1
package/dist_ts/interfaces.d.ts
CHANGED
|
@@ -353,7 +353,14 @@ export interface IFlexProjectionSnapshotV1 {
|
|
|
353
353
|
stagedTerminals: IFlexTerminalProjection[];
|
|
354
354
|
}
|
|
355
355
|
export type TFlexReversionSegmentStatus = 'capturing' | 'completed' | 'failed' | 'cancelled';
|
|
356
|
-
export
|
|
356
|
+
export type TFlexReversionProtocolVersion = 1 | 2;
|
|
357
|
+
export type TFlexReversionProvenance = 'transcript' | 'workspace';
|
|
358
|
+
export type TFlexReversionDisposition = 'pending' | 'revertible' | 'no-change' | 'nonrevertible';
|
|
359
|
+
export interface IFlexAffectedWorkspace {
|
|
360
|
+
readonly id: string;
|
|
361
|
+
readonly label: string;
|
|
362
|
+
}
|
|
363
|
+
interface IFlexReversionSegmentV2 {
|
|
357
364
|
runId: string;
|
|
358
365
|
userMessageId: string;
|
|
359
366
|
status: TFlexReversionSegmentStatus;
|
|
@@ -363,12 +370,22 @@ export interface IFlexReversionSegment {
|
|
|
363
370
|
captureId?: string;
|
|
364
371
|
workspaceReference?: TJsonValue;
|
|
365
372
|
}
|
|
366
|
-
export interface
|
|
373
|
+
export interface IFlexReversionSegment extends IFlexReversionSegmentV2 {
|
|
374
|
+
protocolVersion: TFlexReversionProtocolVersion;
|
|
375
|
+
provenance: TFlexReversionProvenance;
|
|
376
|
+
disposition?: TFlexReversionDisposition;
|
|
377
|
+
affectedWorkspaces?: IFlexAffectedWorkspace[];
|
|
378
|
+
reasonCode?: string;
|
|
379
|
+
}
|
|
380
|
+
interface IFlexPendingCaptureReversionV2 {
|
|
367
381
|
kind: 'capture';
|
|
368
382
|
runId: string;
|
|
369
383
|
captureId: string;
|
|
370
384
|
state: 'preparing' | 'prepared' | 'finalizing';
|
|
371
385
|
}
|
|
386
|
+
export interface IFlexPendingCaptureReversion extends IFlexPendingCaptureReversionV2 {
|
|
387
|
+
protocolVersion: TFlexReversionProtocolVersion;
|
|
388
|
+
}
|
|
372
389
|
export interface IFlexPendingApplyReversion {
|
|
373
390
|
kind: 'apply';
|
|
374
391
|
operationId: string;
|
|
@@ -378,26 +395,41 @@ export interface IFlexPendingApplyReversion {
|
|
|
378
395
|
segmentRunIds: string[];
|
|
379
396
|
appliedRunIds: string[];
|
|
380
397
|
}
|
|
398
|
+
type TFlexPendingReversionV2 = IFlexPendingCaptureReversionV2 | IFlexPendingApplyReversion;
|
|
381
399
|
export type TFlexPendingReversion = IFlexPendingCaptureReversion | IFlexPendingApplyReversion;
|
|
382
|
-
|
|
400
|
+
interface IFlexPendingReversionReleaseV2 {
|
|
383
401
|
runId: string;
|
|
384
402
|
captureId: string;
|
|
385
403
|
reference: TJsonValue;
|
|
386
404
|
}
|
|
405
|
+
export interface IFlexPendingReversionRelease extends IFlexPendingReversionReleaseV2 {
|
|
406
|
+
protocolVersion: TFlexReversionProtocolVersion;
|
|
407
|
+
}
|
|
387
408
|
export interface IFlexProjectionSnapshotV2 {
|
|
388
409
|
schemaVersion: 2;
|
|
389
410
|
revision: number;
|
|
390
411
|
messages: IFlexMessage[];
|
|
391
412
|
stagedTerminals: IFlexTerminalProjection[];
|
|
413
|
+
reversionSegments: IFlexReversionSegmentV2[];
|
|
414
|
+
revertCursor: number;
|
|
415
|
+
excludedRunIds: string[];
|
|
416
|
+
pendingReversion?: TFlexPendingReversionV2;
|
|
417
|
+
pendingReversionReleases: IFlexPendingReversionReleaseV2[];
|
|
418
|
+
}
|
|
419
|
+
export interface IFlexProjectionSnapshotV3 {
|
|
420
|
+
schemaVersion: 3;
|
|
421
|
+
revision: number;
|
|
422
|
+
messages: IFlexMessage[];
|
|
423
|
+
stagedTerminals: IFlexTerminalProjection[];
|
|
392
424
|
reversionSegments: IFlexReversionSegment[];
|
|
393
425
|
revertCursor: number;
|
|
394
426
|
excludedRunIds: string[];
|
|
395
427
|
pendingReversion?: TFlexPendingReversion;
|
|
396
428
|
pendingReversionReleases: IFlexPendingReversionRelease[];
|
|
397
429
|
}
|
|
398
|
-
export type IFlexProjectionSnapshot = IFlexProjectionSnapshotV1 | IFlexProjectionSnapshotV2;
|
|
430
|
+
export type IFlexProjectionSnapshot = IFlexProjectionSnapshotV1 | IFlexProjectionSnapshotV2 | IFlexProjectionSnapshotV3;
|
|
399
431
|
export type TFlexProjectionSnapshot = IFlexProjectionSnapshot;
|
|
400
|
-
export type IFlexProjectionSnapshotCurrent =
|
|
432
|
+
export type IFlexProjectionSnapshotCurrent = IFlexProjectionSnapshotV3;
|
|
401
433
|
export interface IFlexPermissionSnapshot {
|
|
402
434
|
schemaVersion: 1;
|
|
403
435
|
revision: number;
|
|
@@ -469,6 +501,10 @@ export declare const FLEX_REVERSION_MAXIMUM_LIMITS: Readonly<{
|
|
|
469
501
|
maxPendingReversionReleases: 10000;
|
|
470
502
|
}>;
|
|
471
503
|
export declare const FLEX_REVERSION_REFERENCE_MAX_BYTES: number;
|
|
504
|
+
export declare const FLEX_REVERSION_MAX_AFFECTED_WORKSPACES = 64;
|
|
505
|
+
export declare const FLEX_REVERSION_WORKSPACE_ID_MAX_BYTES = 512;
|
|
506
|
+
export declare const FLEX_REVERSION_WORKSPACE_LABEL_MAX_BYTES = 2048;
|
|
507
|
+
export declare const FLEX_REVERSION_REASON_CODE_MAX_BYTES = 128;
|
|
472
508
|
export interface IFlexTurnReversionBaseContext<TScope> {
|
|
473
509
|
readonly scopeId: string;
|
|
474
510
|
readonly scope: TScope;
|
|
@@ -501,6 +537,52 @@ export interface IFlexTurnReversionProvider<TScope> {
|
|
|
501
537
|
inspectApply(context: IFlexTurnReversionApplyContext<TScope>): Promise<IFlexTurnReversionApplyInspection> | IFlexTurnReversionApplyInspection;
|
|
502
538
|
release(context: IFlexTurnReversionReleaseContext<TScope>): Promise<void> | void;
|
|
503
539
|
}
|
|
540
|
+
export interface IFlexTurnReversionRevertibleOutcome {
|
|
541
|
+
readonly disposition: 'revertible';
|
|
542
|
+
readonly reference: TJsonValue;
|
|
543
|
+
readonly affectedWorkspaces: readonly IFlexAffectedWorkspace[];
|
|
544
|
+
}
|
|
545
|
+
export interface IFlexTurnReversionNoChangeOutcome {
|
|
546
|
+
readonly disposition: 'no-change';
|
|
547
|
+
readonly reference: TJsonValue;
|
|
548
|
+
readonly affectedWorkspaces?: readonly [];
|
|
549
|
+
}
|
|
550
|
+
export interface IFlexTurnReversionNonrevertibleOutcome {
|
|
551
|
+
readonly disposition: 'nonrevertible';
|
|
552
|
+
readonly reference: TJsonValue;
|
|
553
|
+
readonly reasonCode: string;
|
|
554
|
+
readonly affectedWorkspaces?: readonly IFlexAffectedWorkspace[];
|
|
555
|
+
}
|
|
556
|
+
export type TFlexTurnReversionFinalizedOutcome = IFlexTurnReversionRevertibleOutcome | IFlexTurnReversionNoChangeOutcome | IFlexTurnReversionNonrevertibleOutcome;
|
|
557
|
+
export type TFlexTurnReversionCaptureInspectionV2 = {
|
|
558
|
+
readonly status: 'missing' | 'prepared' | 'unknown';
|
|
559
|
+
} | {
|
|
560
|
+
readonly status: 'finalized';
|
|
561
|
+
readonly outcome: TFlexTurnReversionFinalizedOutcome;
|
|
562
|
+
};
|
|
563
|
+
export interface IFlexTurnReversionProviderV2<TScope> {
|
|
564
|
+
readonly protocolVersion: 2;
|
|
565
|
+
prepare(context: IFlexTurnReversionBaseContext<TScope>): Promise<void> | void;
|
|
566
|
+
inspectCapture(context: IFlexTurnReversionBaseContext<TScope>): Promise<TFlexTurnReversionCaptureInspectionV2> | TFlexTurnReversionCaptureInspectionV2;
|
|
567
|
+
finalize(context: IFlexTurnReversionBaseContext<TScope>): Promise<TFlexTurnReversionFinalizedOutcome> | TFlexTurnReversionFinalizedOutcome;
|
|
568
|
+
apply(context: IFlexTurnReversionApplyContext<TScope>): Promise<void> | void;
|
|
569
|
+
inspectApply(context: IFlexTurnReversionApplyContext<TScope>): Promise<IFlexTurnReversionApplyInspection> | IFlexTurnReversionApplyInspection;
|
|
570
|
+
release(context: IFlexTurnReversionReleaseContext<TScope>): Promise<void> | void;
|
|
571
|
+
}
|
|
572
|
+
export type TFlexReversionPolicy = 'transcript-optional' | 'workspace-required';
|
|
573
|
+
export type TFlexSessionReversionGroupKind = 'candidate' | 'barrier' | 'no-change';
|
|
574
|
+
export interface IFlexSessionReversionGroup {
|
|
575
|
+
readonly runId: string;
|
|
576
|
+
readonly kind: TFlexSessionReversionGroupKind;
|
|
577
|
+
readonly visibility: 'visible' | 'hidden';
|
|
578
|
+
readonly affectedWorkspaces: readonly IFlexAffectedWorkspace[];
|
|
579
|
+
readonly affectedWorkspacesTruncated: boolean;
|
|
580
|
+
}
|
|
581
|
+
export interface IFlexSessionReversionInfo {
|
|
582
|
+
readonly undoAvailable: boolean;
|
|
583
|
+
readonly redoAvailable: boolean;
|
|
584
|
+
readonly groups: readonly IFlexSessionReversionGroup[];
|
|
585
|
+
}
|
|
504
586
|
export interface IFlexUndoSessionResult {
|
|
505
587
|
revertedRunId: string;
|
|
506
588
|
}
|
|
@@ -567,7 +649,8 @@ export interface IFlexHarnessOptions<TScope> {
|
|
|
567
649
|
callbackLimits?: IFlexCallbackLimits;
|
|
568
650
|
promptQueueLimits?: IFlexPromptQueueLimits;
|
|
569
651
|
reversionLimits?: IFlexReversionLimits;
|
|
570
|
-
turnReversionProvider?: IFlexTurnReversionProvider<TScope>;
|
|
652
|
+
turnReversionProvider?: IFlexTurnReversionProvider<TScope> | IFlexTurnReversionProviderV2<TScope>;
|
|
653
|
+
reversionPolicy?: TFlexReversionPolicy;
|
|
571
654
|
externalErrorProjector?: TFlexExternalErrorProjector;
|
|
572
655
|
subagents?: IFlexSubagentDefinition[];
|
|
573
656
|
slashCommands?: readonly TFlexSlashCommandRegistration<TScope>[];
|
|
@@ -684,3 +767,4 @@ export interface IFlexErrorInfo {
|
|
|
684
767
|
}
|
|
685
768
|
export type TFlexHarnessEvent = IFlexSessionCreatedEvent | IFlexSessionUpdatedEvent | IFlexSessionDeletedEvent | IFlexRunStartedEvent | IFlexMessageChangedEvent | IFlexPartChangedEvent | IFlexPermissionRequestedEvent | IFlexPermissionResolvedEvent | IFlexRunFinishedEvent | IFlexPromptQueueEvent | IFlexSessionHistoryChangedEvent;
|
|
686
769
|
export type TFlexHarnessEventListener = (event: TFlexHarnessEvent) => void;
|
|
770
|
+
export {};
|
package/dist_ts/interfaces.js
CHANGED
|
@@ -11,4 +11,8 @@ export const FLEX_REVERSION_MAXIMUM_LIMITS = Object.freeze({
|
|
|
11
11
|
maxPendingReversionReleases: 10_000,
|
|
12
12
|
});
|
|
13
13
|
export const FLEX_REVERSION_REFERENCE_MAX_BYTES = 256 * 1024;
|
|
14
|
-
|
|
14
|
+
export const FLEX_REVERSION_MAX_AFFECTED_WORKSPACES = 64;
|
|
15
|
+
export const FLEX_REVERSION_WORKSPACE_ID_MAX_BYTES = 512;
|
|
16
|
+
export const FLEX_REVERSION_WORKSPACE_LABEL_MAX_BYTES = 2048;
|
|
17
|
+
export const FLEX_REVERSION_REASON_CODE_MAX_BYTES = 128;
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBeW9CQSxNQUFNLENBQUMsTUFBTSw2QkFBNkIsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDO0lBQ3pELGlCQUFpQixFQUFFLEdBQUc7SUFDdEIsV0FBVyxFQUFFLEdBQUc7SUFDaEIsaUJBQWlCLEVBQUUsSUFBSTtJQUN2QiwyQkFBMkIsRUFBRSxJQUFJO0NBQ2xDLENBQUMsQ0FBQztBQUVILE1BQU0sQ0FBQyxNQUFNLDZCQUE2QixHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUM7SUFDekQsaUJBQWlCLEVBQUUsSUFBSTtJQUN2QixXQUFXLEVBQUUsSUFBSTtJQUNqQixpQkFBaUIsRUFBRSxNQUFNO0lBQ3pCLDJCQUEyQixFQUFFLE1BQU07Q0FDcEMsQ0FBQyxDQUFDO0FBRUgsTUFBTSxDQUFDLE1BQU0sa0NBQWtDLEdBQUcsR0FBRyxHQUFHLElBQUksQ0FBQztBQUM3RCxNQUFNLENBQUMsTUFBTSxzQ0FBc0MsR0FBRyxFQUFFLENBQUM7QUFDekQsTUFBTSxDQUFDLE1BQU0scUNBQXFDLEdBQUcsR0FBRyxDQUFDO0FBQ3pELE1BQU0sQ0FBQyxNQUFNLHdDQUF3QyxHQUFHLElBQUksQ0FBQztBQUM3RCxNQUFNLENBQUMsTUFBTSxvQ0FBb0MsR0FBRyxHQUFHLENBQUMifQ==
|
package/dist_ts/utils.json.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { IFlexJsonLimits, IFlexPermissionSnapshot, IFlexProjectionSnapshotV1, IFlexProjectionSnapshotV2, IFlexScopeSnapshot, TFlexAgentModelMessage, TJsonValue } from './interfaces.js';
|
|
1
|
+
import type { IFlexJsonLimits, IFlexPermissionSnapshot, IFlexProjectionSnapshotV1, IFlexProjectionSnapshotV2, IFlexProjectionSnapshotV3, IFlexScopeSnapshot, TFlexAgentModelMessage, TJsonValue } from './interfaces.js';
|
|
2
2
|
export declare function resolveJsonLimits(limits?: IFlexJsonLimits): Required<IFlexJsonLimits>;
|
|
3
3
|
export declare function normalizeJsonValue(value: unknown, limits?: IFlexJsonLimits): TJsonValue;
|
|
4
4
|
export declare function assertJsonSerializable(value: unknown, path?: string): void;
|
|
5
5
|
export declare function assertFlexScopeSnapshot(value: unknown): asserts value is IFlexScopeSnapshot;
|
|
6
6
|
export declare function assertFlexProjectionSnapshotV1(value: unknown): asserts value is IFlexProjectionSnapshotV1;
|
|
7
7
|
export declare function assertFlexProjectionSnapshotV2(value: unknown): asserts value is IFlexProjectionSnapshotV2;
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function assertFlexProjectionSnapshotV3(value: unknown): asserts value is IFlexProjectionSnapshotV3;
|
|
9
|
+
export declare function assertFlexProjectionSnapshot(value: unknown): asserts value is IFlexProjectionSnapshotV1 | IFlexProjectionSnapshotV2 | IFlexProjectionSnapshotV3;
|
|
9
10
|
export declare function assertFlexPermissionSnapshot(value: unknown): asserts value is IFlexPermissionSnapshot;
|
|
10
11
|
export declare function cloneSerializable<T>(value: T): T;
|
|
11
12
|
export declare function deepFreeze<T>(value: T): T;
|