@agtlantis/core 0.5.0 → 0.6.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/README.md +18 -5
- package/dist/errors/index.d.ts +4 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +3 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/types.d.ts +69 -0
- package/dist/errors/types.d.ts.map +1 -0
- package/dist/errors/types.js +116 -0
- package/dist/errors/types.js.map +1 -0
- package/dist/errors/utils.d.ts +17 -0
- package/dist/errors/utils.d.ts.map +1 -0
- package/dist/errors/utils.js +16 -0
- package/dist/errors/utils.js.map +1 -0
- package/dist/execution/constants.d.ts +7 -0
- package/dist/execution/constants.d.ts.map +1 -0
- package/dist/execution/constants.js +7 -0
- package/dist/execution/constants.js.map +1 -0
- package/dist/execution/index.d.ts +8 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +7 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/mapping.d.ts +17 -0
- package/dist/execution/mapping.d.ts.map +1 -0
- package/dist/execution/mapping.js +197 -0
- package/dist/execution/mapping.js.map +1 -0
- package/dist/execution/shared.d.ts +86 -0
- package/dist/execution/shared.d.ts.map +1 -0
- package/dist/execution/shared.js +100 -0
- package/dist/execution/shared.js.map +1 -0
- package/dist/execution/simple-host.d.ts +56 -0
- package/dist/execution/simple-host.d.ts.map +1 -0
- package/dist/execution/simple-host.js +126 -0
- package/dist/execution/simple-host.js.map +1 -0
- package/dist/execution/streaming-host.d.ts +79 -0
- package/dist/execution/streaming-host.d.ts.map +1 -0
- package/dist/execution/streaming-host.js +276 -0
- package/dist/execution/streaming-host.js.map +1 -0
- package/dist/execution/testing/fixtures.d.ts +67 -0
- package/dist/execution/testing/fixtures.d.ts.map +1 -0
- package/dist/execution/testing/fixtures.js +145 -0
- package/dist/execution/testing/fixtures.js.map +1 -0
- package/dist/execution/testing/helpers.d.ts +218 -0
- package/dist/execution/testing/helpers.d.ts.map +1 -0
- package/dist/execution/testing/helpers.js +327 -0
- package/dist/execution/testing/helpers.js.map +1 -0
- package/dist/execution/testing/host-configs.d.ts +56 -0
- package/dist/execution/testing/host-configs.d.ts.map +1 -0
- package/dist/execution/testing/host-configs.js +154 -0
- package/dist/execution/testing/host-configs.js.map +1 -0
- package/dist/execution/testing/vitest-assertions.d.ts +102 -0
- package/dist/execution/testing/vitest-assertions.d.ts.map +1 -0
- package/dist/execution/testing/vitest-assertions.js +142 -0
- package/dist/execution/testing/vitest-assertions.js.map +1 -0
- package/dist/execution/types.d.ts +432 -0
- package/dist/execution/types.d.ts.map +1 -0
- package/dist/execution/types.js +2 -0
- package/dist/execution/types.js.map +1 -0
- package/dist/execution/utils.d.ts +68 -0
- package/dist/execution/utils.d.ts.map +1 -0
- package/dist/execution/utils.js +93 -0
- package/dist/execution/utils.js.map +1 -0
- package/dist/index.d.ts +10 -1506
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -2979
- package/dist/index.js.map +1 -1
- package/dist/observability/index.d.ts +4 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +2 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/logger.d.ts +161 -0
- package/dist/observability/logger.d.ts.map +1 -0
- package/dist/observability/logger.js +31 -0
- package/dist/observability/logger.js.map +1 -0
- package/dist/observability/types.d.ts +46 -0
- package/dist/observability/types.d.ts.map +1 -0
- package/dist/observability/types.js +2 -0
- package/dist/observability/types.js.map +1 -0
- package/dist/patterns/index.d.ts +2 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +2 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/patterns/progressive/index.d.ts +2 -0
- package/dist/patterns/progressive/index.d.ts.map +1 -0
- package/dist/patterns/progressive/index.js +2 -0
- package/dist/patterns/progressive/index.js.map +1 -0
- package/dist/patterns/progressive/progressive-pattern.d.ts +174 -0
- package/dist/patterns/progressive/progressive-pattern.d.ts.map +1 -0
- package/dist/patterns/progressive/progressive-pattern.js +260 -0
- package/dist/patterns/progressive/progressive-pattern.js.map +1 -0
- package/dist/pricing/calculator.d.ts +71 -0
- package/dist/pricing/calculator.d.ts.map +1 -0
- package/dist/pricing/calculator.js +127 -0
- package/dist/pricing/calculator.js.map +1 -0
- package/dist/pricing/config.d.ts +61 -0
- package/dist/pricing/config.d.ts.map +1 -0
- package/dist/pricing/config.js +87 -0
- package/dist/pricing/config.js.map +1 -0
- package/dist/pricing/defaults.d.ts +29 -0
- package/dist/pricing/defaults.d.ts.map +1 -0
- package/dist/pricing/defaults.js +139 -0
- package/dist/pricing/defaults.js.map +1 -0
- package/dist/pricing/index.d.ts +40 -0
- package/dist/pricing/index.d.ts.map +1 -0
- package/dist/pricing/index.js +43 -0
- package/dist/pricing/index.js.map +1 -0
- package/dist/pricing/types.d.ts +96 -0
- package/dist/pricing/types.d.ts.map +1 -0
- package/dist/pricing/types.js +7 -0
- package/dist/pricing/types.js.map +1 -0
- package/dist/pricing/validator.d.ts +55 -0
- package/dist/pricing/validator.d.ts.map +1 -0
- package/dist/pricing/validator.js +84 -0
- package/dist/pricing/validator.js.map +1 -0
- package/dist/prompt/errors.d.ts +112 -0
- package/dist/prompt/errors.d.ts.map +1 -0
- package/dist/prompt/errors.js +174 -0
- package/dist/prompt/errors.js.map +1 -0
- package/dist/prompt/file-prompt-repository.d.ts +80 -0
- package/dist/prompt/file-prompt-repository.d.ts.map +1 -0
- package/dist/prompt/file-prompt-repository.js +287 -0
- package/dist/prompt/file-prompt-repository.js.map +1 -0
- package/dist/prompt/index.d.ts +34 -0
- package/dist/prompt/index.d.ts.map +1 -0
- package/dist/prompt/index.js +37 -0
- package/dist/prompt/index.js.map +1 -0
- package/dist/prompt/prompt-template.d.ts +64 -0
- package/dist/prompt/prompt-template.d.ts.map +1 -0
- package/dist/prompt/prompt-template.js +90 -0
- package/dist/prompt/prompt-template.js.map +1 -0
- package/dist/prompt/template.d.ts +23 -0
- package/dist/prompt/template.d.ts.map +1 -0
- package/dist/prompt/template.js +70 -0
- package/dist/prompt/template.js.map +1 -0
- package/dist/prompt/types.d.ts +148 -0
- package/dist/prompt/types.d.ts.map +1 -0
- package/dist/prompt/types.js +7 -0
- package/dist/prompt/types.js.map +1 -0
- package/dist/provider/base-file-manager.d.ts +14 -0
- package/dist/provider/base-file-manager.d.ts.map +1 -0
- package/dist/provider/base-file-manager.js +91 -0
- package/dist/provider/base-file-manager.js.map +1 -0
- package/dist/provider/base-provider.d.ts +41 -0
- package/dist/provider/base-provider.d.ts.map +1 -0
- package/dist/provider/base-provider.js +21 -0
- package/dist/provider/base-provider.js.map +1 -0
- package/dist/provider/file-cache.d.ts +14 -0
- package/dist/provider/file-cache.d.ts.map +1 -0
- package/dist/provider/file-cache.js +29 -0
- package/dist/provider/file-cache.js.map +1 -0
- package/dist/provider/file-source.d.ts +32 -0
- package/dist/provider/file-source.d.ts.map +1 -0
- package/dist/provider/file-source.js +180 -0
- package/dist/provider/file-source.js.map +1 -0
- package/dist/provider/file-utils.d.ts +5 -0
- package/dist/provider/file-utils.d.ts.map +1 -0
- package/dist/provider/file-utils.js +15 -0
- package/dist/provider/file-utils.js.map +1 -0
- package/dist/provider/google/factory.d.ts +107 -0
- package/dist/provider/google/factory.d.ts.map +1 -0
- package/dist/provider/google/factory.js +143 -0
- package/dist/provider/google/factory.js.map +1 -0
- package/dist/provider/google/file-manager.d.ts +10 -0
- package/dist/provider/google/file-manager.d.ts.map +1 -0
- package/dist/provider/google/file-manager.js +93 -0
- package/dist/provider/google/file-manager.js.map +1 -0
- package/dist/provider/google/index.d.ts +8 -0
- package/dist/provider/google/index.d.ts.map +1 -0
- package/dist/provider/google/index.js +10 -0
- package/dist/provider/google/index.js.map +1 -0
- package/dist/provider/hash.d.ts +3 -0
- package/dist/provider/hash.d.ts.map +1 -0
- package/dist/provider/hash.js +34 -0
- package/dist/provider/hash.js.map +1 -0
- package/dist/provider/index.d.ts +10 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +12 -0
- package/dist/provider/index.js.map +1 -0
- package/dist/provider/noop-file-manager.d.ts +9 -0
- package/dist/provider/noop-file-manager.d.ts.map +1 -0
- package/dist/provider/noop-file-manager.js +28 -0
- package/dist/provider/noop-file-manager.js.map +1 -0
- package/dist/provider/openai/factory.d.ts +67 -0
- package/dist/provider/openai/factory.d.ts.map +1 -0
- package/dist/provider/openai/factory.js +100 -0
- package/dist/provider/openai/factory.js.map +1 -0
- package/dist/provider/openai/file-manager.d.ts +17 -0
- package/dist/provider/openai/file-manager.d.ts.map +1 -0
- package/dist/provider/openai/file-manager.js +108 -0
- package/dist/provider/openai/file-manager.js.map +1 -0
- package/dist/provider/openai/index.d.ts +8 -0
- package/dist/provider/openai/index.d.ts.map +1 -0
- package/dist/provider/openai/index.js +8 -0
- package/dist/provider/openai/index.js.map +1 -0
- package/dist/provider/types.d.ts +105 -0
- package/dist/provider/types.d.ts.map +1 -0
- package/dist/provider/types.js +19 -0
- package/dist/provider/types.js.map +1 -0
- package/dist/session/index.d.ts +7 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +5 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/simple-session.d.ts +98 -0
- package/dist/session/simple-session.d.ts.map +1 -0
- package/dist/session/simple-session.js +299 -0
- package/dist/session/simple-session.js.map +1 -0
- package/dist/session/streaming-session.d.ts +90 -0
- package/dist/session/streaming-session.d.ts.map +1 -0
- package/dist/session/streaming-session.js +151 -0
- package/dist/session/streaming-session.js.map +1 -0
- package/dist/session/test-utils.d.ts +19 -0
- package/dist/session/test-utils.d.ts.map +1 -0
- package/dist/session/test-utils.js +65 -0
- package/dist/session/test-utils.js.map +1 -0
- package/dist/session/types.d.ts +219 -0
- package/dist/session/types.d.ts.map +1 -0
- package/dist/session/types.js +181 -0
- package/dist/session/types.js.map +1 -0
- package/dist/session/usage-extractors.d.ts +7 -0
- package/dist/session/usage-extractors.d.ts.map +1 -0
- package/dist/session/usage-extractors.js +71 -0
- package/dist/session/usage-extractors.js.map +1 -0
- package/dist/testing/fixtures.d.ts +34 -0
- package/dist/testing/fixtures.d.ts.map +1 -0
- package/dist/testing/fixtures.js +65 -0
- package/dist/testing/fixtures.js.map +1 -0
- package/dist/testing/helpers.d.ts +20 -0
- package/dist/testing/helpers.d.ts.map +1 -0
- package/dist/testing/helpers.js +32 -0
- package/dist/testing/helpers.js.map +1 -0
- package/dist/testing/index.d.ts +7 -519
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +21 -2123
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/mock-provider.d.ts +79 -0
- package/dist/testing/mock-provider.d.ts.map +1 -0
- package/dist/testing/mock-provider.js +152 -0
- package/dist/testing/mock-provider.js.map +1 -0
- package/dist/testing/mock.d.ts +29 -0
- package/dist/testing/mock.d.ts.map +1 -0
- package/dist/testing/mock.js +154 -0
- package/dist/testing/mock.js.map +1 -0
- package/dist/testing/test-execution.d.ts +14 -0
- package/dist/testing/test-execution.d.ts.map +1 -0
- package/dist/testing/test-execution.js +108 -0
- package/dist/testing/test-execution.js.map +1 -0
- package/dist/utils/deep-merge.d.ts +6 -0
- package/dist/utils/deep-merge.d.ts.map +1 -0
- package/dist/utils/deep-merge.js +24 -0
- package/dist/utils/deep-merge.js.map +1 -0
- package/dist/validation/errors.d.ts +28 -0
- package/dist/validation/errors.d.ts.map +1 -0
- package/dist/validation/errors.js +38 -0
- package/dist/validation/errors.js.map +1 -0
- package/dist/validation/index.d.ts +5 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +4 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/types.d.ts +49 -0
- package/dist/validation/types.d.ts.map +1 -0
- package/dist/validation/types.js +2 -0
- package/dist/validation/types.js.map +1 -0
- package/dist/validation/validation-history.d.ts +12 -0
- package/dist/validation/validation-history.d.ts.map +1 -0
- package/dist/validation/validation-history.js +29 -0
- package/dist/validation/validation-history.js.map +1 -0
- package/dist/validation/with-validation.d.ts +38 -0
- package/dist/validation/with-validation.d.ts.map +1 -0
- package/dist/validation/with-validation.js +58 -0
- package/dist/validation/with-validation.js.map +1 -0
- package/package.json +71 -75
- package/dist/base-provider-2TTw5HAa.d.cts +0 -1254
- package/dist/base-provider-2TTw5HAa.d.ts +0 -1254
- package/dist/index.cjs +0 -3085
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -1506
- package/dist/testing/index.cjs +0 -2167
- package/dist/testing/index.cjs.map +0 -1
- package/dist/testing/index.d.cts +0 -520
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test helpers for execution module tests.
|
|
3
|
+
* Provides reusable utilities for abort scenarios, generator creation,
|
|
4
|
+
* and logger tracking.
|
|
5
|
+
*
|
|
6
|
+
* These helpers are framework-agnostic (no vitest/jest dependency).
|
|
7
|
+
*/
|
|
8
|
+
import type { SessionEvent, ExtractResult, EmittableEventInput } from '../types.js';
|
|
9
|
+
import type { Logger } from '../../observability/logger.js';
|
|
10
|
+
import type { SimpleSession } from '../../session/simple-session.js';
|
|
11
|
+
export type LoggerEventType = 'start' | 'emit' | 'done' | 'error';
|
|
12
|
+
/**
|
|
13
|
+
* Abort scenario helper for testing cancellation flows.
|
|
14
|
+
*/
|
|
15
|
+
export interface AbortScenario {
|
|
16
|
+
/** The AbortController instance */
|
|
17
|
+
controller: AbortController;
|
|
18
|
+
/** The AbortSignal to pass to execution */
|
|
19
|
+
signal: AbortSignal;
|
|
20
|
+
/** Call to abort with optional reason */
|
|
21
|
+
abort: (reason?: string) => void;
|
|
22
|
+
/** Check if signal is aborted */
|
|
23
|
+
isAborted: () => boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create an abort scenario for testing cancellation.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const { signal, abort, isAborted } = createAbortScenario();
|
|
31
|
+
* const execution = new SimpleExecutionHost(factory, fn, signal);
|
|
32
|
+
*
|
|
33
|
+
* abort('User canceled');
|
|
34
|
+
* expect(isAborted()).toBe(true);
|
|
35
|
+
*
|
|
36
|
+
* const result = await execution.result();
|
|
37
|
+
* expectCanceledResult(result);
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function createAbortScenario(): AbortScenario;
|
|
41
|
+
/**
|
|
42
|
+
* Create an already-aborted signal for testing pre-aborted scenarios.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const signal = createAlreadyAbortedSignal('Pre-aborted');
|
|
47
|
+
* const execution = new SimpleExecutionHost(factory, fn, signal);
|
|
48
|
+
*
|
|
49
|
+
* const result = await execution.result();
|
|
50
|
+
* expectCanceledResult(result);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function createAlreadyAbortedSignal(reason?: string): AbortSignal;
|
|
54
|
+
/**
|
|
55
|
+
* Create a simple generator that emits specified events and returns the result.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const generator = createSimpleGenerator('result-value', [
|
|
60
|
+
* { type: 'progress', message: 'step 1' },
|
|
61
|
+
* { type: 'progress', message: 'step 2' },
|
|
62
|
+
* ]);
|
|
63
|
+
* const execution = new StreamingExecutionHost(factory, generator);
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare function createSimpleGenerator<TEvent extends {
|
|
67
|
+
type: string;
|
|
68
|
+
}>(result: ExtractResult<TEvent>, events?: EmittableEventInput<TEvent>[]): (session: {
|
|
69
|
+
emit: (event: EmittableEventInput<TEvent>) => SessionEvent<TEvent>;
|
|
70
|
+
done: (value: ExtractResult<TEvent>) => Promise<SessionEvent<TEvent>>;
|
|
71
|
+
}) => AsyncGenerator<SessionEvent<TEvent>, SessionEvent<TEvent> | Promise<SessionEvent<TEvent>>, unknown>;
|
|
72
|
+
/**
|
|
73
|
+
* Create a generator that throws an error.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const generator = createErrorGenerator(new Error('Test error'));
|
|
78
|
+
* const execution = new StreamingExecutionHost(factory, generator);
|
|
79
|
+
*
|
|
80
|
+
* const result = await execution.result();
|
|
81
|
+
* expectFailedResult(result, 'Test error');
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export declare function createErrorGenerator<TEvent extends {
|
|
85
|
+
type: string;
|
|
86
|
+
}>(error: Error, eventsBeforeError?: EmittableEventInput<TEvent>[]): (session: {
|
|
87
|
+
emit: (event: EmittableEventInput<TEvent>) => SessionEvent<TEvent>;
|
|
88
|
+
}) => AsyncGenerator<SessionEvent<TEvent>, never, unknown>;
|
|
89
|
+
/**
|
|
90
|
+
* Create a generator that waits for cancellation using closure pattern.
|
|
91
|
+
* Uses the provided AbortScenario to detect when to abort.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const abortScenario = createAbortScenario();
|
|
96
|
+
* const onCancelCalled = vi.fn();
|
|
97
|
+
* const generator = createCancelableGenerator(abortScenario, onCancelCalled);
|
|
98
|
+
*
|
|
99
|
+
* const execution = new StreamingExecutionHost(factory, generator, abortScenario.signal);
|
|
100
|
+
* abortScenario.abort();
|
|
101
|
+
*
|
|
102
|
+
* const result = await execution.result();
|
|
103
|
+
* expectCanceledResult(result);
|
|
104
|
+
* expect(onCancelCalled).toHaveBeenCalled();
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
export declare function createCancelableGenerator<TEvent extends {
|
|
108
|
+
type: string;
|
|
109
|
+
}>(abortScenario: AbortScenario, onCancel?: () => void, eventsBeforeWait?: EmittableEventInput<TEvent>[]): (session: {
|
|
110
|
+
emit: (event: EmittableEventInput<TEvent>) => SessionEvent<TEvent>;
|
|
111
|
+
}) => AsyncGenerator<SessionEvent<TEvent>, void, unknown>;
|
|
112
|
+
/**
|
|
113
|
+
* Create a function that waits for cancellation using closure pattern.
|
|
114
|
+
* Uses the provided AbortScenario to detect when to abort.
|
|
115
|
+
* Equivalent of createCancelableGenerator for SimpleExecutionHost.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* const abortScenario = createAbortScenario();
|
|
120
|
+
* const onCancelCalled = vi.fn();
|
|
121
|
+
* const fn = createCancelableFunction(abortScenario, onCancelCalled);
|
|
122
|
+
*
|
|
123
|
+
* const execution = new SimpleExecutionHost(factory, fn, abortScenario.signal);
|
|
124
|
+
* abortScenario.abort();
|
|
125
|
+
*
|
|
126
|
+
* const result = await execution.result();
|
|
127
|
+
* expectCanceledResult(result);
|
|
128
|
+
* expect(onCancelCalled).toHaveBeenCalled();
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export declare function createCancelableFunction(abortScenario: AbortScenario, onCancel?: () => void): (session: SimpleSession) => Promise<unknown>;
|
|
132
|
+
/**
|
|
133
|
+
* Create a generator with delay, useful for timing-related tests.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* const generator = createDelayedGenerator(100, 'result');
|
|
138
|
+
* const execution = new StreamingExecutionHost(factory, generator);
|
|
139
|
+
*
|
|
140
|
+
* // Cancel before delay completes
|
|
141
|
+
* setTimeout(() => execution.cancel(), 50);
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export declare function createDelayedGenerator<TEvent extends {
|
|
145
|
+
type: string;
|
|
146
|
+
}>(delayMs: number, result: ExtractResult<TEvent>, abortScenario?: AbortScenario): (session: {
|
|
147
|
+
emit: (event: EmittableEventInput<TEvent>) => SessionEvent<TEvent>;
|
|
148
|
+
done: (value: ExtractResult<TEvent>) => Promise<SessionEvent<TEvent>>;
|
|
149
|
+
}) => AsyncGenerator<SessionEvent<TEvent>, SessionEvent<TEvent> | Promise<SessionEvent<TEvent>>, unknown>;
|
|
150
|
+
/**
|
|
151
|
+
* Create a generator that yields events with a configurable delay between each.
|
|
152
|
+
* Useful for race condition testing where timing control is needed.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* const generator = createSlowGenerator([
|
|
157
|
+
* { type: 'chunk', content: 'A' },
|
|
158
|
+
* { type: 'chunk', content: 'B' },
|
|
159
|
+
* ], 10);
|
|
160
|
+
* const execution = new StreamingExecutionHost(factory, generator);
|
|
161
|
+
*
|
|
162
|
+
* // Cancel mid-stream
|
|
163
|
+
* setTimeout(() => execution.cancel(), 15);
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
export declare function createSlowGenerator<TEvent extends {
|
|
167
|
+
type: string;
|
|
168
|
+
}>(events: EmittableEventInput<TEvent>[], delayBetweenEventsMs: number, abortScenario?: AbortScenario): (session: {
|
|
169
|
+
emit: (event: EmittableEventInput<TEvent>) => SessionEvent<TEvent>;
|
|
170
|
+
}) => AsyncGenerator<SessionEvent<TEvent>, SessionEvent<TEvent> | undefined, unknown>;
|
|
171
|
+
/**
|
|
172
|
+
* Collect all events from an async iterable stream.
|
|
173
|
+
* Useful for testing stream() output in race condition scenarios.
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```typescript
|
|
177
|
+
* const events = await collectStreamAsync(execution.stream());
|
|
178
|
+
* expect(events).toHaveLength(3);
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
export declare function collectStreamAsync<T>(stream: AsyncIterable<T>): Promise<T[]>;
|
|
182
|
+
/**
|
|
183
|
+
* Create a generator that never completes (infinite wait).
|
|
184
|
+
* Useful for testing cleanup and cancellation behavior.
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```typescript
|
|
188
|
+
* const generator = createNeverEndingGenerator([
|
|
189
|
+
* { type: 'chunk', content: 'A' },
|
|
190
|
+
* ]);
|
|
191
|
+
* const execution = new StreamingExecutionHost(factory, generator);
|
|
192
|
+
*
|
|
193
|
+
* // Must cancel to complete
|
|
194
|
+
* execution.cancel();
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
export declare function createNeverEndingGenerator<TEvent extends {
|
|
198
|
+
type: string;
|
|
199
|
+
}>(eventsBeforeWait?: EmittableEventInput<TEvent>[], abortScenario?: AbortScenario): (session: {
|
|
200
|
+
emit: (event: EmittableEventInput<TEvent>) => SessionEvent<TEvent>;
|
|
201
|
+
}) => AsyncGenerator<SessionEvent<TEvent>, SessionEvent<TEvent> | undefined, unknown>;
|
|
202
|
+
/**
|
|
203
|
+
* Create a logger that tracks call order for sequence verification.
|
|
204
|
+
* This version is framework-agnostic (no vitest/jest dependency).
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```typescript
|
|
208
|
+
* const { logger, getCallOrder } = createOrderTrackingLogger();
|
|
209
|
+
* // ... run execution with logger ...
|
|
210
|
+
*
|
|
211
|
+
* expect(getCallOrder()).toEqual(['start', 'emit', 'done']);
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
export declare function createOrderTrackingLogger(): {
|
|
215
|
+
logger: Logger;
|
|
216
|
+
getCallOrder: () => LoggerEventType[];
|
|
217
|
+
};
|
|
218
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/execution/testing/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAMrE,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAMlE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5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BA"}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test helpers for execution module tests.
|
|
3
|
+
* Provides reusable utilities for abort scenarios, generator creation,
|
|
4
|
+
* and logger tracking.
|
|
5
|
+
*
|
|
6
|
+
* These helpers are framework-agnostic (no vitest/jest dependency).
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Create an abort scenario for testing cancellation.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const { signal, abort, isAborted } = createAbortScenario();
|
|
14
|
+
* const execution = new SimpleExecutionHost(factory, fn, signal);
|
|
15
|
+
*
|
|
16
|
+
* abort('User canceled');
|
|
17
|
+
* expect(isAborted()).toBe(true);
|
|
18
|
+
*
|
|
19
|
+
* const result = await execution.result();
|
|
20
|
+
* expectCanceledResult(result);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export function createAbortScenario() {
|
|
24
|
+
const controller = new AbortController();
|
|
25
|
+
return {
|
|
26
|
+
controller,
|
|
27
|
+
signal: controller.signal,
|
|
28
|
+
abort: (reason) => controller.abort(reason),
|
|
29
|
+
isAborted: () => controller.signal.aborted,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create an already-aborted signal for testing pre-aborted scenarios.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const signal = createAlreadyAbortedSignal('Pre-aborted');
|
|
38
|
+
* const execution = new SimpleExecutionHost(factory, fn, signal);
|
|
39
|
+
*
|
|
40
|
+
* const result = await execution.result();
|
|
41
|
+
* expectCanceledResult(result);
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export function createAlreadyAbortedSignal(reason = 'Already aborted') {
|
|
45
|
+
const controller = new AbortController();
|
|
46
|
+
controller.abort(reason);
|
|
47
|
+
return controller.signal;
|
|
48
|
+
}
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// Generator Helpers (for StreamingExecutionHost)
|
|
51
|
+
// ============================================================================
|
|
52
|
+
/**
|
|
53
|
+
* Create a simple generator that emits specified events and returns the result.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const generator = createSimpleGenerator('result-value', [
|
|
58
|
+
* { type: 'progress', message: 'step 1' },
|
|
59
|
+
* { type: 'progress', message: 'step 2' },
|
|
60
|
+
* ]);
|
|
61
|
+
* const execution = new StreamingExecutionHost(factory, generator);
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export function createSimpleGenerator(result, events = []) {
|
|
65
|
+
return async function* (session) {
|
|
66
|
+
for (const event of events) {
|
|
67
|
+
yield session.emit(event);
|
|
68
|
+
}
|
|
69
|
+
return session.done(result);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Create a generator that throws an error.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const generator = createErrorGenerator(new Error('Test error'));
|
|
78
|
+
* const execution = new StreamingExecutionHost(factory, generator);
|
|
79
|
+
*
|
|
80
|
+
* const result = await execution.result();
|
|
81
|
+
* expectFailedResult(result, 'Test error');
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export function createErrorGenerator(error, eventsBeforeError = []) {
|
|
85
|
+
return async function* (session) {
|
|
86
|
+
for (const event of eventsBeforeError) {
|
|
87
|
+
yield session.emit(event);
|
|
88
|
+
}
|
|
89
|
+
throw error;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Create a generator that waits for cancellation using closure pattern.
|
|
94
|
+
* Uses the provided AbortScenario to detect when to abort.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* const abortScenario = createAbortScenario();
|
|
99
|
+
* const onCancelCalled = vi.fn();
|
|
100
|
+
* const generator = createCancelableGenerator(abortScenario, onCancelCalled);
|
|
101
|
+
*
|
|
102
|
+
* const execution = new StreamingExecutionHost(factory, generator, abortScenario.signal);
|
|
103
|
+
* abortScenario.abort();
|
|
104
|
+
*
|
|
105
|
+
* const result = await execution.result();
|
|
106
|
+
* expectCanceledResult(result);
|
|
107
|
+
* expect(onCancelCalled).toHaveBeenCalled();
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export function createCancelableGenerator(abortScenario, onCancel, eventsBeforeWait = []) {
|
|
111
|
+
return async function* (session) {
|
|
112
|
+
for (const event of eventsBeforeWait) {
|
|
113
|
+
yield session.emit(event);
|
|
114
|
+
}
|
|
115
|
+
// Wait indefinitely, checking for abort via closure
|
|
116
|
+
await new Promise((_, reject) => {
|
|
117
|
+
const signal = abortScenario.signal;
|
|
118
|
+
if (signal.aborted) {
|
|
119
|
+
onCancel?.();
|
|
120
|
+
reject(new DOMException('Aborted', 'AbortError'));
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
signal.addEventListener('abort', () => {
|
|
124
|
+
onCancel?.();
|
|
125
|
+
reject(new DOMException('Aborted', 'AbortError'));
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Create a function that waits for cancellation using closure pattern.
|
|
132
|
+
* Uses the provided AbortScenario to detect when to abort.
|
|
133
|
+
* Equivalent of createCancelableGenerator for SimpleExecutionHost.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* const abortScenario = createAbortScenario();
|
|
138
|
+
* const onCancelCalled = vi.fn();
|
|
139
|
+
* const fn = createCancelableFunction(abortScenario, onCancelCalled);
|
|
140
|
+
*
|
|
141
|
+
* const execution = new SimpleExecutionHost(factory, fn, abortScenario.signal);
|
|
142
|
+
* abortScenario.abort();
|
|
143
|
+
*
|
|
144
|
+
* const result = await execution.result();
|
|
145
|
+
* expectCanceledResult(result);
|
|
146
|
+
* expect(onCancelCalled).toHaveBeenCalled();
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export function createCancelableFunction(abortScenario, onCancel) {
|
|
150
|
+
return async () => {
|
|
151
|
+
// Wait indefinitely, checking for abort via closure
|
|
152
|
+
await new Promise((_, reject) => {
|
|
153
|
+
const signal = abortScenario.signal;
|
|
154
|
+
if (signal.aborted) {
|
|
155
|
+
onCancel?.();
|
|
156
|
+
reject(new DOMException('Aborted', 'AbortError'));
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
signal.addEventListener('abort', () => {
|
|
160
|
+
onCancel?.();
|
|
161
|
+
reject(new DOMException('Aborted', 'AbortError'));
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
return 'should-not-reach';
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Create a generator with delay, useful for timing-related tests.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* const generator = createDelayedGenerator(100, 'result');
|
|
173
|
+
* const execution = new StreamingExecutionHost(factory, generator);
|
|
174
|
+
*
|
|
175
|
+
* // Cancel before delay completes
|
|
176
|
+
* setTimeout(() => execution.cancel(), 50);
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
export function createDelayedGenerator(delayMs, result, abortScenario) {
|
|
180
|
+
return async function* (session) {
|
|
181
|
+
await new Promise((resolve, reject) => {
|
|
182
|
+
const timeoutId = setTimeout(resolve, delayMs);
|
|
183
|
+
if (abortScenario) {
|
|
184
|
+
abortScenario.signal.addEventListener('abort', () => {
|
|
185
|
+
clearTimeout(timeoutId);
|
|
186
|
+
reject(new DOMException('Aborted', 'AbortError'));
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
return session.done(result);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
// ============================================================================
|
|
194
|
+
// Race Condition & Concurrency Test Helpers
|
|
195
|
+
// ============================================================================
|
|
196
|
+
/**
|
|
197
|
+
* Create a generator that yields events with a configurable delay between each.
|
|
198
|
+
* Useful for race condition testing where timing control is needed.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```typescript
|
|
202
|
+
* const generator = createSlowGenerator([
|
|
203
|
+
* { type: 'chunk', content: 'A' },
|
|
204
|
+
* { type: 'chunk', content: 'B' },
|
|
205
|
+
* ], 10);
|
|
206
|
+
* const execution = new StreamingExecutionHost(factory, generator);
|
|
207
|
+
*
|
|
208
|
+
* // Cancel mid-stream
|
|
209
|
+
* setTimeout(() => execution.cancel(), 15);
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
export function createSlowGenerator(events, delayBetweenEventsMs, abortScenario) {
|
|
213
|
+
return async function* (session) {
|
|
214
|
+
for (const event of events) {
|
|
215
|
+
// Check abort before each event
|
|
216
|
+
if (abortScenario?.isAborted()) {
|
|
217
|
+
throw new DOMException('Aborted', 'AbortError');
|
|
218
|
+
}
|
|
219
|
+
await new Promise((resolve, reject) => {
|
|
220
|
+
const timeoutId = setTimeout(resolve, delayBetweenEventsMs);
|
|
221
|
+
if (abortScenario) {
|
|
222
|
+
if (abortScenario.signal.aborted) {
|
|
223
|
+
clearTimeout(timeoutId);
|
|
224
|
+
reject(new DOMException('Aborted', 'AbortError'));
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
abortScenario.signal.addEventListener('abort', () => {
|
|
228
|
+
clearTimeout(timeoutId);
|
|
229
|
+
reject(new DOMException('Aborted', 'AbortError'));
|
|
230
|
+
}, { once: true });
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
yield session.emit(event);
|
|
234
|
+
}
|
|
235
|
+
return undefined;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Collect all events from an async iterable stream.
|
|
240
|
+
* Useful for testing stream() output in race condition scenarios.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```typescript
|
|
244
|
+
* const events = await collectStreamAsync(execution.stream());
|
|
245
|
+
* expect(events).toHaveLength(3);
|
|
246
|
+
* ```
|
|
247
|
+
*/
|
|
248
|
+
export async function collectStreamAsync(stream) {
|
|
249
|
+
const collected = [];
|
|
250
|
+
for await (const event of stream) {
|
|
251
|
+
collected.push(event);
|
|
252
|
+
}
|
|
253
|
+
return collected;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Create a generator that never completes (infinite wait).
|
|
257
|
+
* Useful for testing cleanup and cancellation behavior.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```typescript
|
|
261
|
+
* const generator = createNeverEndingGenerator([
|
|
262
|
+
* { type: 'chunk', content: 'A' },
|
|
263
|
+
* ]);
|
|
264
|
+
* const execution = new StreamingExecutionHost(factory, generator);
|
|
265
|
+
*
|
|
266
|
+
* // Must cancel to complete
|
|
267
|
+
* execution.cancel();
|
|
268
|
+
* ```
|
|
269
|
+
*/
|
|
270
|
+
export function createNeverEndingGenerator(eventsBeforeWait = [], abortScenario) {
|
|
271
|
+
return async function* (session) {
|
|
272
|
+
for (const event of eventsBeforeWait) {
|
|
273
|
+
yield session.emit(event);
|
|
274
|
+
}
|
|
275
|
+
// Wait forever unless aborted
|
|
276
|
+
await new Promise((_, reject) => {
|
|
277
|
+
if (abortScenario) {
|
|
278
|
+
if (abortScenario.signal.aborted) {
|
|
279
|
+
reject(new DOMException('Aborted', 'AbortError'));
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
abortScenario.signal.addEventListener('abort', () => reject(new DOMException('Aborted', 'AbortError')), { once: true });
|
|
283
|
+
}
|
|
284
|
+
// Without abort scenario, this promise never settles
|
|
285
|
+
});
|
|
286
|
+
return undefined;
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
// ============================================================================
|
|
290
|
+
// Logger Tracking Helpers (framework-agnostic)
|
|
291
|
+
// ============================================================================
|
|
292
|
+
/**
|
|
293
|
+
* Create a logger that tracks call order for sequence verification.
|
|
294
|
+
* This version is framework-agnostic (no vitest/jest dependency).
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* ```typescript
|
|
298
|
+
* const { logger, getCallOrder } = createOrderTrackingLogger();
|
|
299
|
+
* // ... run execution with logger ...
|
|
300
|
+
*
|
|
301
|
+
* expect(getCallOrder()).toEqual(['start', 'emit', 'done']);
|
|
302
|
+
* ```
|
|
303
|
+
*/
|
|
304
|
+
export function createOrderTrackingLogger() {
|
|
305
|
+
const callOrder = [];
|
|
306
|
+
const logger = {
|
|
307
|
+
onLLMCallStart: () => { },
|
|
308
|
+
onLLMCallEnd: () => { },
|
|
309
|
+
onExecutionStart: () => {
|
|
310
|
+
callOrder.push('start');
|
|
311
|
+
},
|
|
312
|
+
onExecutionEmit: () => {
|
|
313
|
+
callOrder.push('emit');
|
|
314
|
+
},
|
|
315
|
+
onExecutionDone: () => {
|
|
316
|
+
callOrder.push('done');
|
|
317
|
+
},
|
|
318
|
+
onExecutionError: () => {
|
|
319
|
+
callOrder.push('error');
|
|
320
|
+
},
|
|
321
|
+
};
|
|
322
|
+
return {
|
|
323
|
+
logger,
|
|
324
|
+
getCallOrder: () => [...callOrder],
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/execution/testing/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8BH;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,OAAO;QACL,UAAU;QACV,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,KAAK,EAAE,CAAC,MAAe,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;QACpD,SAAS,EAAE,GAAG,EAAE,CAAC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E,YAAY,CAAC,CAAC,CAAC;oBAClD,OAAO;gBACT,CAAC;gBACD,aAAa,CAAC,MAAM,CAAC,gBAAgB,CACnC,OAAO,EACP,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,EACvD,EAAE,IAAI,EAAE,IAAI,EAAE,CACf,CAAC;YACJ,CAAC;YACD,qDAAqD;QACvD,CAAC,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,+CAA+C;AAC/C,+EAA+E;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,yBAAyB;IAIvC,MAAM,SAAS,GAAsB,EAAE,CAAC;IAExC,MAAM,MAAM,GAAW;QACrB,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;QACxB,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;QACtB,gBAAgB,EAAE,GAAG,EAAE;YACrB,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;QACD,eAAe,EAAE,GAAG,EAAE;YACpB,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;QACD,eAAe,EAAE,GAAG,EAAE;YACpB,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;QACD,gBAAgB,EAAE,GAAG,EAAE;YACrB,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;KACF,CAAC;IAEF,OAAO;QACL,MAAM;QACN,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration objects for ExecutionHost contract tests.
|
|
3
|
+
* Abstracts the differences between SimpleHost and StreamingHost
|
|
4
|
+
* to enable shared contract testing.
|
|
5
|
+
*/
|
|
6
|
+
import type { SessionStreamGeneratorFn } from '../types.js';
|
|
7
|
+
import { SimpleSession } from '../../session/simple-session.js';
|
|
8
|
+
import { StreamingSession } from '../../session/streaming-session.js';
|
|
9
|
+
import { TestEvent } from './fixtures.js';
|
|
10
|
+
import type { AbortScenario } from './helpers.js';
|
|
11
|
+
import type { Logger } from '../../observability/logger.js';
|
|
12
|
+
export type SimpleSessionFactory = (signal?: AbortSignal) => SimpleSession;
|
|
13
|
+
export type StreamingSessionFactory = (signal?: AbortSignal) => StreamingSession<TestEvent>;
|
|
14
|
+
export type SimpleWorkload = (session: SimpleSession) => Promise<unknown>;
|
|
15
|
+
export type StreamingWorkload = SessionStreamGeneratorFn<TestEvent>;
|
|
16
|
+
export interface ExecutionHost<TResult = string> {
|
|
17
|
+
result(): Promise<{
|
|
18
|
+
status: string;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
cancel(): void;
|
|
22
|
+
cleanup(): Promise<void>;
|
|
23
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for testing an ExecutionHost implementation.
|
|
27
|
+
* Abstracts the differences between SimpleHost and StreamingHost.
|
|
28
|
+
*/
|
|
29
|
+
export interface ExecutionHostTestConfig<TResult = string> {
|
|
30
|
+
/** Name of the host for test descriptions */
|
|
31
|
+
name: 'SimpleExecutionHost' | 'StreamingExecutionHost';
|
|
32
|
+
/** Create a host with given factory, workload, and optional signal */
|
|
33
|
+
createHost: (factory: SimpleSessionFactory | StreamingSessionFactory, workload: SimpleWorkload | StreamingWorkload, signal?: AbortSignal) => ExecutionHost<TResult>;
|
|
34
|
+
/** Create a session factory with optional logger */
|
|
35
|
+
createSessionFactory: (logger?: Logger) => SimpleSessionFactory | StreamingSessionFactory;
|
|
36
|
+
/** Create a session factory spy for signal verification */
|
|
37
|
+
createSessionFactorySpy: () => {
|
|
38
|
+
factory: SimpleSessionFactory | StreamingSessionFactory;
|
|
39
|
+
getPassedSignal: () => AbortSignal | undefined;
|
|
40
|
+
};
|
|
41
|
+
/** Create a workload that succeeds with the given result */
|
|
42
|
+
createSuccessWorkload: (result: TResult) => SimpleWorkload | StreamingWorkload;
|
|
43
|
+
/** Create a workload that fails with the given error */
|
|
44
|
+
createErrorWorkload: (error: Error) => SimpleWorkload | StreamingWorkload;
|
|
45
|
+
/** Create a workload that waits for cancellation via closure pattern */
|
|
46
|
+
createCancelableWorkload: (abortScenario: AbortScenario, onCancel?: () => void) => SimpleWorkload | StreamingWorkload;
|
|
47
|
+
/** Create a workload that registers onDone hooks */
|
|
48
|
+
createHookWorkload: (hook: () => void, options?: {
|
|
49
|
+
shouldFail?: boolean;
|
|
50
|
+
}) => SimpleWorkload | StreamingWorkload;
|
|
51
|
+
}
|
|
52
|
+
export declare const simpleHostConfig: ExecutionHostTestConfig<string>;
|
|
53
|
+
export declare const streamingHostConfig: ExecutionHostTestConfig<string>;
|
|
54
|
+
/** All host configurations for parameterized testing */
|
|
55
|
+
export declare const allHostConfigs: readonly [ExecutionHostTestConfig<string>, ExecutionHostTestConfig<string>];
|
|
56
|
+
//# sourceMappingURL=host-configs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-configs.d.ts","sourceRoot":"","sources":["../../../src/execution/testing/host-configs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAG5D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAEL,SAAS,EAGV,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAM5D,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,CAAC,EAAE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