@aigne/core 0.4.205 → 0.4.206

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 (48) hide show
  1. package/lib/cjs/agent.js +27 -1
  2. package/lib/cjs/definitions/data-type-schema.js +2 -2
  3. package/lib/cjs/function-agent.js +34 -29
  4. package/lib/cjs/function-runner.js +6 -4
  5. package/lib/cjs/index.js +1 -1
  6. package/lib/cjs/llm-agent.js +22 -54
  7. package/lib/cjs/llm-decision-agent.js +8 -12
  8. package/lib/cjs/llm-model.js +2 -2
  9. package/lib/cjs/local-function-agent.js +7 -21
  10. package/lib/cjs/pipeline-agent.js +9 -19
  11. package/lib/cjs/runnable.js +1 -0
  12. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  13. package/lib/cjs/utils/index.js +5 -2
  14. package/lib/cjs/utils/stream-utils.js +35 -13
  15. package/lib/esm/agent.js +29 -3
  16. package/lib/esm/definitions/data-type-schema.js +2 -2
  17. package/lib/esm/function-agent.js +33 -28
  18. package/lib/esm/function-runner.js +6 -4
  19. package/lib/esm/index.js +1 -1
  20. package/lib/esm/llm-agent.js +22 -53
  21. package/lib/esm/llm-decision-agent.js +8 -11
  22. package/lib/esm/llm-model.js +2 -2
  23. package/lib/esm/local-function-agent.js +7 -20
  24. package/lib/esm/pipeline-agent.js +9 -18
  25. package/lib/esm/runnable.js +1 -0
  26. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  27. package/lib/esm/utils/index.js +5 -2
  28. package/lib/esm/utils/stream-utils.js +33 -13
  29. package/lib/types/agent.d.ts +8 -9
  30. package/lib/types/context.d.ts +2 -0
  31. package/lib/types/definitions/data-type-schema.d.ts +7 -5
  32. package/lib/types/{data-type.d.ts → definitions/data-type.d.ts} +2 -2
  33. package/lib/types/function-agent.d.ts +33 -20
  34. package/lib/types/function-runner.d.ts +20 -7
  35. package/lib/types/index.d.ts +1 -1
  36. package/lib/types/llm-agent.d.ts +27 -30
  37. package/lib/types/llm-decision-agent.d.ts +15 -22
  38. package/lib/types/llm-model.d.ts +2 -2
  39. package/lib/types/local-function-agent.d.ts +31 -34
  40. package/lib/types/pipeline-agent.d.ts +21 -55
  41. package/lib/types/runnable.d.ts +1 -1
  42. package/lib/types/tsconfig.tsbuildinfo +1 -1
  43. package/lib/types/utils/index.d.ts +5 -2
  44. package/lib/types/utils/stream-utils.d.ts +5 -3
  45. package/lib/types/utils/union.d.ts +1 -2
  46. package/package.json +3 -2
  47. /package/lib/cjs/{data-type.js → definitions/data-type.js} +0 -0
  48. /package/lib/esm/{data-type.js → definitions/data-type.js} +0 -0
@@ -1,4 +1,7 @@
1
- export * from './ordered-map';
2
1
  export * from './is-non-nullable';
3
- export * from './stream-utils';
4
2
  export * from './mustache-utils';
3
+ export * from './nullable';
4
+ export * from './omit';
5
+ export * from './ordered-map';
6
+ export * from './stream-utils';
7
+ export * from './union';
@@ -1,10 +1,10 @@
1
- import { RunnableResponse, RunnableResponseStream } from '../runnable';
1
+ import { RunnableResponse, RunnableResponseChunk, RunnableResponseStream } from '../runnable';
2
2
  export declare function objectToRunnableResponseStream<T extends {
3
3
  [key: string]: any;
4
4
  }>(obj: T): RunnableResponseStream<T>;
5
5
  export declare function runnableResponseStreamToObject<T extends {
6
6
  [key: string]: any;
7
- }>(stream: RunnableResponseStream<T>): Promise<T>;
7
+ }>(stream: RunnableResponseStream<T> | AsyncGenerator<RunnableResponseChunk<T>>): Promise<T>;
8
8
  /**
9
9
  * Extracts the outputs from a runnable output stream and run the
10
10
  * resolve function on the result before the stream closes. It can be
@@ -15,4 +15,6 @@ export declare function runnableResponseStreamToObject<T extends {
15
15
  */
16
16
  export declare function extractOutputsFromRunnableOutput<T extends {
17
17
  [key: string]: any;
18
- }>(output: RunnableResponse<T>, resolve: (result: T) => Promise<void> | void): Promise<typeof output>;
18
+ }>(output: RunnableResponse<T> | AsyncGenerator<RunnableResponseChunk<T>>, resolve: (result: T) => Promise<void> | void): Promise<RunnableResponse<T>>;
19
+ export declare function asyncGeneratorToReadableStream<T>(generator: AsyncGenerator<T>): ReadableStream<T>;
20
+ export declare function isAsyncGenerator<T extends AsyncGenerator>(value: any): value is T;
@@ -1,2 +1 @@
1
- export type UnionToIntersection<U> = (U extends any ? (arg: U) => void : never) extends (arg: infer I) => void ? I : never;
2
- export type ObjectUnionToIntersection<T, O = object> = UnionToIntersection<T> extends O ? UnionToIntersection<T> : never;
1
+ export type UnionToIntersection<U, O = any> = (U extends any ? (arg: U) => void : never) extends (arg: infer I) => void ? I extends O ? I : never : never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/core",
3
- "version": "0.4.205",
3
+ "version": "0.4.206",
4
4
  "description": "AIGNE core library",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -49,6 +49,7 @@
49
49
  },
50
50
  "devDependencies": {
51
51
  "@tsconfig/recommended": "^1.0.8",
52
+ "@types/bun": "^1.1.16",
52
53
  "npm-run-all": "^4.1.5",
53
54
  "rimraf": "^6.0.1",
54
55
  "ts-jest": "^29.2.5",
@@ -62,6 +63,6 @@
62
63
  "build:esm": "tsc -p tsconfig.json --module es2022 --outDir lib/esm",
63
64
  "build:types": "tsc -p tsconfig.json --declaration --emitDeclarationOnly --outDir lib/types",
64
65
  "clean": "rimraf lib",
65
- "test": "jest src/"
66
+ "test": "bun test"
66
67
  }
67
68
  }