@output.ai/core 0.1.1 → 0.1.3
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 +98 -8
- package/package.json +8 -2
- package/src/consts.js +2 -0
- package/src/index.d.ts +36 -4
- package/src/interface/evaluator.js +4 -4
- package/src/interface/step.js +4 -4
- package/src/interface/validations/static.js +16 -2
- package/src/interface/validations/static.spec.js +20 -0
- package/src/interface/workflow.js +19 -14
- package/src/interface/zod_integration.spec.js +6 -6
- package/src/internal_activities/index.js +1 -1
- package/src/utils/index.d.ts +35 -0
- package/src/utils/index.js +2 -0
- package/src/utils/resolve_invocation_dir.js +27 -0
- package/src/utils/resolve_invocation_dir.spec.js +102 -0
- package/src/utils/utils.js +37 -0
- package/src/utils/utils.spec.js +60 -0
- package/src/worker/interceptors/workflow.js +10 -1
- package/src/worker/loader.js +31 -4
- package/src/worker/loader.spec.js +14 -3
- package/src/worker/webpack_loaders/workflow_rewriter/collect_target_imports.js +38 -20
- package/src/worker/webpack_loaders/workflow_rewriter/index.mjs +5 -4
- package/src/worker/webpack_loaders/workflow_rewriter/index.spec.js +48 -0
- package/src/worker/webpack_loaders/workflow_rewriter/rewrite_fn_bodies.js +16 -20
- package/src/worker/webpack_loaders/workflow_rewriter/tools.js +23 -0
- package/src/interface/metadata.js +0 -4
- package/src/interface/utils.js +0 -19
- package/src/interface/utils.spec.js +0 -35
- package/src/utils.js +0 -8
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { getInvocationDir } from './utils.js';
|
|
3
|
-
|
|
4
|
-
describe( 'interface/utils', () => {
|
|
5
|
-
describe( 'getInvocationDir', () => {
|
|
6
|
-
it( 'returns the caller directory from stack trace', () => {
|
|
7
|
-
const fakeCaller = '/tmp/project/src/caller/file.js';
|
|
8
|
-
const OriginalError = Error;
|
|
9
|
-
// Provide a deterministic stack shape for the function under test
|
|
10
|
-
// Lines: 1) Error, 2) getInvocationDir, 3) step/workflow, 4) actual caller
|
|
11
|
-
// Include typical V8 formatting with leading spaces and without function name
|
|
12
|
-
// for the caller line
|
|
13
|
-
|
|
14
|
-
Error = class extends OriginalError {
|
|
15
|
-
constructor( ...args ) {
|
|
16
|
-
super( ...args );
|
|
17
|
-
this.stack = [
|
|
18
|
-
'Error',
|
|
19
|
-
' at getInvocationDir (a:1:1)',
|
|
20
|
-
' at step (b:1:1)',
|
|
21
|
-
` at ${fakeCaller}:10:20`
|
|
22
|
-
].join( '\n' );
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
try {
|
|
26
|
-
const dir = getInvocationDir();
|
|
27
|
-
expect( dir ).toBe( '/tmp/project/src/caller' );
|
|
28
|
-
} finally {
|
|
29
|
-
|
|
30
|
-
Error = OriginalError;
|
|
31
|
-
}
|
|
32
|
-
} );
|
|
33
|
-
} );
|
|
34
|
-
} );
|
|
35
|
-
|