gauss-ai 4.0.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.
Files changed (232) hide show
  1. package/CHANGELOG.md +489 -0
  2. package/LICENSE +21 -0
  3. package/README.md +269 -0
  4. package/dist/a2a/index.cjs +7 -0
  5. package/dist/a2a/index.cjs.map +1 -0
  6. package/dist/a2a/index.d.cts +30 -0
  7. package/dist/a2a/index.d.ts +30 -0
  8. package/dist/a2a/index.js +7 -0
  9. package/dist/a2a/index.js.map +1 -0
  10. package/dist/agent-UIQDSYCE.js +16 -0
  11. package/dist/agent-UIQDSYCE.js.map +1 -0
  12. package/dist/agent-builder-8W3mBR-N.d.ts +1075 -0
  13. package/dist/agent-builder-GEMYdb1p.d.cts +1075 -0
  14. package/dist/agent-graph-AMQYAWNF.js +1422 -0
  15. package/dist/agent-graph-AMQYAWNF.js.map +1 -0
  16. package/dist/ai-sdk-mcp.adapter-SEN6KHNU.js +124 -0
  17. package/dist/ai-sdk-mcp.adapter-SEN6KHNU.js.map +1 -0
  18. package/dist/browser/index.js +10 -0
  19. package/dist/browser/index.js.map +1 -0
  20. package/dist/bun-runtime.adapter-MQDAJLQM.js +8 -0
  21. package/dist/bun-runtime.adapter-MQDAJLQM.js.map +1 -0
  22. package/dist/bun-runtime.adapter-XKOUXVAK.cjs +8 -0
  23. package/dist/bun-runtime.adapter-XKOUXVAK.cjs.map +1 -0
  24. package/dist/chat-A3XMRPJL.js +129 -0
  25. package/dist/chat-A3XMRPJL.js.map +1 -0
  26. package/dist/chunk-2ZRU47NC.js +91 -0
  27. package/dist/chunk-2ZRU47NC.js.map +1 -0
  28. package/dist/chunk-3LD3JTH4.cjs +18 -0
  29. package/dist/chunk-3LD3JTH4.cjs.map +1 -0
  30. package/dist/chunk-5FE5TG2W.cjs +16 -0
  31. package/dist/chunk-5FE5TG2W.cjs.map +1 -0
  32. package/dist/chunk-6XF673YC.cjs +436 -0
  33. package/dist/chunk-6XF673YC.cjs.map +1 -0
  34. package/dist/chunk-7CKWZJNS.js +230 -0
  35. package/dist/chunk-7CKWZJNS.js.map +1 -0
  36. package/dist/chunk-BI2G665F.js +4588 -0
  37. package/dist/chunk-BI2G665F.js.map +1 -0
  38. package/dist/chunk-C5NLWJS2.js +139 -0
  39. package/dist/chunk-C5NLWJS2.js.map +1 -0
  40. package/dist/chunk-CJZ66SU3.cjs +4321 -0
  41. package/dist/chunk-CJZ66SU3.cjs.map +1 -0
  42. package/dist/chunk-DAMT2CXW.cjs +91 -0
  43. package/dist/chunk-DAMT2CXW.cjs.map +1 -0
  44. package/dist/chunk-E7WG3MO5.js +18 -0
  45. package/dist/chunk-E7WG3MO5.js.map +1 -0
  46. package/dist/chunk-EFDM6R4J.js +99 -0
  47. package/dist/chunk-EFDM6R4J.js.map +1 -0
  48. package/dist/chunk-F7WIPPEO.js +256 -0
  49. package/dist/chunk-F7WIPPEO.js.map +1 -0
  50. package/dist/chunk-FAYDE67N.js +6927 -0
  51. package/dist/chunk-FAYDE67N.js.map +1 -0
  52. package/dist/chunk-GAE2KKCM.js +21 -0
  53. package/dist/chunk-GAE2KKCM.js.map +1 -0
  54. package/dist/chunk-INLNGRXM.cjs +130 -0
  55. package/dist/chunk-INLNGRXM.cjs.map +1 -0
  56. package/dist/chunk-JKXKXB5O.js +130 -0
  57. package/dist/chunk-JKXKXB5O.js.map +1 -0
  58. package/dist/chunk-K6SAETGP.js +375 -0
  59. package/dist/chunk-K6SAETGP.js.map +1 -0
  60. package/dist/chunk-KEASLAYR.js +157 -0
  61. package/dist/chunk-KEASLAYR.js.map +1 -0
  62. package/dist/chunk-KKJVNM6O.js +436 -0
  63. package/dist/chunk-KKJVNM6O.js.map +1 -0
  64. package/dist/chunk-KYIMVRIM.js +16 -0
  65. package/dist/chunk-KYIMVRIM.js.map +1 -0
  66. package/dist/chunk-MB7NXIZD.js +4321 -0
  67. package/dist/chunk-MB7NXIZD.js.map +1 -0
  68. package/dist/chunk-MHHDXPGE.js +209 -0
  69. package/dist/chunk-MHHDXPGE.js.map +1 -0
  70. package/dist/chunk-NE6JJA5W.js +401 -0
  71. package/dist/chunk-NE6JJA5W.js.map +1 -0
  72. package/dist/chunk-PF46XZBF.cjs +6927 -0
  73. package/dist/chunk-PF46XZBF.cjs.map +1 -0
  74. package/dist/chunk-PSJIAGDE.cjs +375 -0
  75. package/dist/chunk-PSJIAGDE.cjs.map +1 -0
  76. package/dist/chunk-PWOQDXNQ.js +16 -0
  77. package/dist/chunk-PWOQDXNQ.js.map +1 -0
  78. package/dist/chunk-QYOMQBBZ.cjs +230 -0
  79. package/dist/chunk-QYOMQBBZ.cjs.map +1 -0
  80. package/dist/chunk-UDFXLC4J.cjs +16 -0
  81. package/dist/chunk-UDFXLC4J.cjs.map +1 -0
  82. package/dist/chunk-UO4NGXRT.cjs +259 -0
  83. package/dist/chunk-UO4NGXRT.cjs.map +1 -0
  84. package/dist/chunk-UPFDFLEW.js +40 -0
  85. package/dist/chunk-UPFDFLEW.js.map +1 -0
  86. package/dist/chunk-V55JSQS7.cjs +16 -0
  87. package/dist/chunk-V55JSQS7.cjs.map +1 -0
  88. package/dist/chunk-VJADHXZL.cjs +16 -0
  89. package/dist/chunk-VJADHXZL.cjs.map +1 -0
  90. package/dist/chunk-VRWD7LCI.js +59 -0
  91. package/dist/chunk-VRWD7LCI.js.map +1 -0
  92. package/dist/chunk-WKKQ443C.js +487 -0
  93. package/dist/chunk-WKKQ443C.js.map +1 -0
  94. package/dist/chunk-X2GHUHAF.js +436 -0
  95. package/dist/chunk-X2GHUHAF.js.map +1 -0
  96. package/dist/chunk-XLGW3XNI.cjs +256 -0
  97. package/dist/chunk-XLGW3XNI.cjs.map +1 -0
  98. package/dist/chunk-ZFJKX4DP.js +16 -0
  99. package/dist/chunk-ZFJKX4DP.js.map +1 -0
  100. package/dist/chunk-ZM2OEWM2.js +259 -0
  101. package/dist/chunk-ZM2OEWM2.js.map +1 -0
  102. package/dist/chunk-ZNAIP2XV.js +16 -0
  103. package/dist/chunk-ZNAIP2XV.js.map +1 -0
  104. package/dist/chunk-ZYFAZYSL.js +42 -0
  105. package/dist/chunk-ZYFAZYSL.js.map +1 -0
  106. package/dist/cli/index.js +421 -0
  107. package/dist/cli/index.js.map +1 -0
  108. package/dist/config-4MHT6TQW.js +153 -0
  109. package/dist/config-4MHT6TQW.js.map +1 -0
  110. package/dist/config-REERQFK4.cjs +153 -0
  111. package/dist/config-REERQFK4.cjs.map +1 -0
  112. package/dist/cost-tracker-JLOU7IZJ.js +7 -0
  113. package/dist/cost-tracker-JLOU7IZJ.js.map +1 -0
  114. package/dist/demo-C52GMSYH.js +188 -0
  115. package/dist/demo-C52GMSYH.js.map +1 -0
  116. package/dist/deno/index.js +306 -0
  117. package/dist/deno/index.js.map +1 -0
  118. package/dist/deno-runtime.adapter-F744HY7K.js +8 -0
  119. package/dist/deno-runtime.adapter-F744HY7K.js.map +1 -0
  120. package/dist/deno-runtime.adapter-RFEVNSCV.cjs +8 -0
  121. package/dist/deno-runtime.adapter-RFEVNSCV.cjs.map +1 -0
  122. package/dist/dev-D7DDVDA4.js +218 -0
  123. package/dist/dev-D7DDVDA4.js.map +1 -0
  124. package/dist/edge/index.js +10 -0
  125. package/dist/edge/index.js.map +1 -0
  126. package/dist/edge-runtime.adapter-UQCW2F7X.js +8 -0
  127. package/dist/edge-runtime.adapter-UQCW2F7X.js.map +1 -0
  128. package/dist/edge-runtime.adapter-YED6F3AY.cjs +8 -0
  129. package/dist/edge-runtime.adapter-YED6F3AY.cjs.map +1 -0
  130. package/dist/graph-MGFAQZ5W.js +50 -0
  131. package/dist/graph-MGFAQZ5W.js.map +1 -0
  132. package/dist/graph-visualization-HBSVQXJK.js +9 -0
  133. package/dist/graph-visualization-HBSVQXJK.js.map +1 -0
  134. package/dist/index-BRgqNnh3.d.cts +982 -0
  135. package/dist/index-CZxpYUxZ.d.ts +982 -0
  136. package/dist/index.cjs +14789 -0
  137. package/dist/index.cjs.map +1 -0
  138. package/dist/index.d.cts +10275 -0
  139. package/dist/index.d.ts +10275 -0
  140. package/dist/index.js +14789 -0
  141. package/dist/index.js.map +1 -0
  142. package/dist/init-CFWXTQ35.js +133 -0
  143. package/dist/init-CFWXTQ35.js.map +1 -0
  144. package/dist/llm-VWO4MC7J.cjs +17 -0
  145. package/dist/llm-VWO4MC7J.cjs.map +1 -0
  146. package/dist/llm-XLXVSPBI.js +17 -0
  147. package/dist/llm-XLXVSPBI.js.map +1 -0
  148. package/dist/logging-WRAK5ZXT.js +33 -0
  149. package/dist/logging-WRAK5ZXT.js.map +1 -0
  150. package/dist/metrics-FAHZVVD4.js +47 -0
  151. package/dist/metrics-FAHZVVD4.js.map +1 -0
  152. package/dist/node/index.cjs +280 -0
  153. package/dist/node/index.cjs.map +1 -0
  154. package/dist/node/index.d.cts +51 -0
  155. package/dist/node/index.d.ts +51 -0
  156. package/dist/node/index.js +280 -0
  157. package/dist/node/index.js.map +1 -0
  158. package/dist/node-runtime.adapter-5L7PJ6W2.js +8 -0
  159. package/dist/node-runtime.adapter-5L7PJ6W2.js.map +1 -0
  160. package/dist/node-runtime.adapter-CCRZVGHB.cjs +8 -0
  161. package/dist/node-runtime.adapter-CCRZVGHB.cjs.map +1 -0
  162. package/dist/persist-usage-WTBTCWEF.js +7 -0
  163. package/dist/persist-usage-WTBTCWEF.js.map +1 -0
  164. package/dist/plugin-RCPBWUUA.js +207 -0
  165. package/dist/plugin-RCPBWUUA.js.map +1 -0
  166. package/dist/plugins/index.cjs +75 -0
  167. package/dist/plugins/index.cjs.map +1 -0
  168. package/dist/plugins/index.d.cts +8 -0
  169. package/dist/plugins/index.d.ts +8 -0
  170. package/dist/plugins/index.js +75 -0
  171. package/dist/plugins/index.js.map +1 -0
  172. package/dist/plugins-L4ING3CX.js +4625 -0
  173. package/dist/plugins-L4ING3CX.js.map +1 -0
  174. package/dist/providers/index.cjs +189 -0
  175. package/dist/providers/index.cjs.map +1 -0
  176. package/dist/providers/index.d.cts +168 -0
  177. package/dist/providers/index.d.ts +168 -0
  178. package/dist/providers/index.js +189 -0
  179. package/dist/providers/index.js.map +1 -0
  180. package/dist/providers-3RNQ5CKZ.js +59 -0
  181. package/dist/providers-3RNQ5CKZ.js.map +1 -0
  182. package/dist/providers-66GPXUGQ.cjs +59 -0
  183. package/dist/providers-66GPXUGQ.cjs.map +1 -0
  184. package/dist/repl-K6QN4I2S.js +678 -0
  185. package/dist/repl-K6QN4I2S.js.map +1 -0
  186. package/dist/rest/index.cjs +17 -0
  187. package/dist/rest/index.cjs.map +1 -0
  188. package/dist/rest/index.d.cts +102 -0
  189. package/dist/rest/index.d.ts +102 -0
  190. package/dist/rest/index.js +17 -0
  191. package/dist/rest/index.js.map +1 -0
  192. package/dist/runtime-deno.js +15 -0
  193. package/dist/runtime-deno.js.map +1 -0
  194. package/dist/runtime-edge.js +15 -0
  195. package/dist/runtime-edge.js.map +1 -0
  196. package/dist/runtime-node.js +15 -0
  197. package/dist/runtime-node.js.map +1 -0
  198. package/dist/scraping/index.cjs +11 -0
  199. package/dist/scraping/index.cjs.map +1 -0
  200. package/dist/scraping/index.d.cts +17 -0
  201. package/dist/scraping/index.d.ts +17 -0
  202. package/dist/scraping/index.js +11 -0
  203. package/dist/scraping/index.js.map +1 -0
  204. package/dist/semantic-scraping.port-CZWUea88.d.cts +54 -0
  205. package/dist/semantic-scraping.port-CZWUea88.d.ts +54 -0
  206. package/dist/server/index.js +166 -0
  207. package/dist/server/index.js.map +1 -0
  208. package/dist/testing/index.cjs +25 -0
  209. package/dist/testing/index.cjs.map +1 -0
  210. package/dist/testing/index.d.cts +63 -0
  211. package/dist/testing/index.d.ts +63 -0
  212. package/dist/testing/index.js +25 -0
  213. package/dist/testing/index.js.map +1 -0
  214. package/dist/token-counter.port-CRgxZZGe.d.ts +334 -0
  215. package/dist/token-counter.port-D7BHMCRR.d.cts +334 -0
  216. package/dist/tools-BZM33OBZ.js +10 -0
  217. package/dist/tools-BZM33OBZ.js.map +1 -0
  218. package/dist/tracing-XA3TEWP4.js +48 -0
  219. package/dist/tracing-XA3TEWP4.js.map +1 -0
  220. package/dist/types-CVsP7gFI.d.cts +235 -0
  221. package/dist/types-CVsP7gFI.d.ts +235 -0
  222. package/dist/virtual-fs.adapter-BBLS-3AY.d.ts +26 -0
  223. package/dist/virtual-fs.adapter-nb0CTYOj.d.cts +26 -0
  224. package/dist/workflow/index.cjs +9 -0
  225. package/dist/workflow/index.cjs.map +1 -0
  226. package/dist/workflow/index.d.cts +62 -0
  227. package/dist/workflow/index.d.ts +62 -0
  228. package/dist/workflow/index.js +9 -0
  229. package/dist/workflow/index.js.map +1 -0
  230. package/dist/workflow.port-BaCttxrw.d.cts +153 -0
  231. package/dist/workflow.port-BaCttxrw.d.ts +153 -0
  232. package/package.json +230 -0
@@ -0,0 +1,62 @@
1
+ import { W as WorkflowContext, h as WorkflowStep, R as RetryConfig, a as WorkflowDefinition } from '../workflow.port-BaCttxrw.js';
2
+ export { e as AnyStep, V as ValidationResult, f as WorkflowEvent, c as WorkflowEventListener, b as WorkflowPort, d as WorkflowResult } from '../workflow.port-BaCttxrw.js';
3
+
4
+ type ConditionFn = (ctx: WorkflowContext) => boolean;
5
+ type RollbackFn = (ctx: WorkflowContext) => Promise<void>;
6
+ type PromptFn = (ctx: WorkflowContext) => string;
7
+ interface ConditionalOpts {
8
+ condition: ConditionFn;
9
+ ifTrue: WorkflowStep;
10
+ ifFalse?: WorkflowStep;
11
+ }
12
+ interface LoopOpts {
13
+ body: WorkflowStep;
14
+ condition: ConditionFn;
15
+ maxIterations?: number;
16
+ }
17
+ interface ForeachOpts {
18
+ iterable: string;
19
+ step: WorkflowStep;
20
+ itemKey?: string;
21
+ indexKey?: string;
22
+ aggregateOutputKey?: string;
23
+ aggregationMode?: "array" | "concat" | "merge";
24
+ maxConcurrency?: number;
25
+ maxIterations?: number;
26
+ }
27
+ interface MapOpts {
28
+ input: string;
29
+ transform: WorkflowStep;
30
+ outputKey: string;
31
+ itemKey?: string;
32
+ indexKey?: string;
33
+ filter?: (item: unknown, index: number, ctx: WorkflowContext) => boolean;
34
+ maxConcurrency?: number;
35
+ }
36
+ declare class WorkflowBuilder {
37
+ private readonly id;
38
+ private readonly workflowName;
39
+ private readonly steps;
40
+ private timeoutMs?;
41
+ private initCtx?;
42
+ constructor(id: string, name: string);
43
+ step(id: string, name: string, execute: (ctx: WorkflowContext) => Promise<WorkflowContext>): this;
44
+ parallel(id: string, name: string, branches: WorkflowStep[], mergeStrategy?: 'all' | 'first' | 'race'): this;
45
+ conditional(id: string, name: string, opts: ConditionalOpts): this;
46
+ loop(id: string, name: string, opts: LoopOpts): this;
47
+ foreach(id: string, name: string, opts: ForeachOpts): this;
48
+ map(id: string, name: string, opts: MapOpts): this;
49
+ agentStep(id: string, name: string, prompt: string | PromptFn, outputKey: string): this;
50
+ /** Apply retry config to the last added step */
51
+ withRetry(config: Partial<RetryConfig>): this;
52
+ /** Apply rollback to the last added step */
53
+ withRollback(fn: RollbackFn): this;
54
+ /** Apply condition to the last added step */
55
+ withCondition(fn: ConditionFn): this;
56
+ withTimeout(ms: number): this;
57
+ withInitialContext(ctx: WorkflowContext): this;
58
+ build(): WorkflowDefinition;
59
+ }
60
+ declare function defineWorkflow(id: string, name: string): WorkflowBuilder;
61
+
62
+ export { WorkflowBuilder, WorkflowContext, WorkflowDefinition, defineWorkflow };
@@ -0,0 +1,9 @@
1
+ import {
2
+ WorkflowBuilder,
3
+ defineWorkflow
4
+ } from "../chunk-JKXKXB5O.js";
5
+ export {
6
+ WorkflowBuilder,
7
+ defineWorkflow
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,153 @@
1
+ interface RetryConfig {
2
+ maxAttempts: number;
3
+ backoffMs: number;
4
+ backoffMultiplier: number;
5
+ }
6
+ type WorkflowContext = Record<string, unknown>;
7
+ interface OutputMapping {
8
+ /** Source path in the step output context */
9
+ source: string;
10
+ /** Target key in the next workflow context */
11
+ targetKey: string;
12
+ /** Optional value transform */
13
+ transform?: (value: unknown, result: WorkflowContext) => unknown;
14
+ /** Fallback value when source is missing/undefined */
15
+ defaultValue?: unknown;
16
+ }
17
+ interface InputMapping {
18
+ /** Explicit keys to project from workflow context */
19
+ keys?: string[];
20
+ /** Extract values from paths into new keys */
21
+ paths?: Record<string, string>;
22
+ /** Static default values merged first */
23
+ defaults?: Record<string, unknown>;
24
+ /** Static overrides merged last */
25
+ overrides?: Record<string, unknown>;
26
+ }
27
+ interface WorkflowStep {
28
+ id: string;
29
+ name: string;
30
+ type?: StepType;
31
+ condition?: (ctx: WorkflowContext) => boolean;
32
+ inputMapping?: InputMapping;
33
+ outputMapping?: OutputMapping[];
34
+ execute: (ctx: WorkflowContext) => Promise<WorkflowContext>;
35
+ rollback?: (ctx: WorkflowContext) => Promise<void>;
36
+ retry?: Partial<RetryConfig>;
37
+ }
38
+ interface WorkflowResult {
39
+ status: "completed" | "failed";
40
+ context: WorkflowContext;
41
+ completedSteps: string[];
42
+ skippedSteps: string[];
43
+ failedStep?: string;
44
+ error?: string;
45
+ totalDurationMs: number;
46
+ }
47
+ type StepType = 'sequential' | 'parallel' | 'conditional' | 'loop' | 'agent' | 'foreach' | 'map';
48
+ interface ParallelStep {
49
+ id: string;
50
+ name: string;
51
+ type: 'parallel';
52
+ branches: WorkflowStep[];
53
+ mergeStrategy?: 'all' | 'first' | 'race';
54
+ }
55
+ interface ConditionalStep {
56
+ id: string;
57
+ name: string;
58
+ type: 'conditional';
59
+ condition: (ctx: WorkflowContext) => boolean;
60
+ ifTrue: WorkflowStep;
61
+ ifFalse?: WorkflowStep;
62
+ }
63
+ interface LoopStep {
64
+ id: string;
65
+ name: string;
66
+ type: 'loop';
67
+ body: WorkflowStep;
68
+ condition: (ctx: WorkflowContext) => boolean;
69
+ maxIterations?: number;
70
+ }
71
+ interface ForeachStep {
72
+ id: string;
73
+ name: string;
74
+ type: 'foreach';
75
+ /** Path to iterable in context, e.g. "items" or "payload.results" */
76
+ iterable: string;
77
+ /** Step executed for each item */
78
+ step: WorkflowStep;
79
+ /** Item variable name exposed in item context. Default: "item" */
80
+ itemKey?: string;
81
+ /** Optional index variable name. Default: "index" */
82
+ indexKey?: string;
83
+ /** Aggregate output key in final context. Default: step id */
84
+ aggregateOutputKey?: string;
85
+ /** Aggregate behavior for per-item outputs. Default: "array" */
86
+ aggregationMode?: 'array' | 'concat' | 'merge';
87
+ /** Maximum concurrent item executions. Default: 1 */
88
+ maxConcurrency?: number;
89
+ /** Safety cap on iterations */
90
+ maxIterations?: number;
91
+ }
92
+ interface MapStep {
93
+ id: string;
94
+ name: string;
95
+ type: 'map';
96
+ /** Path to input array in context */
97
+ input: string;
98
+ /** Transform step executed for each item */
99
+ transform: WorkflowStep;
100
+ /** Output collection key */
101
+ outputKey: string;
102
+ /** Item variable name exposed in item context. Default: "item" */
103
+ itemKey?: string;
104
+ /** Optional index variable name. Default: "index" */
105
+ indexKey?: string;
106
+ /** Optional item filter */
107
+ filter?: (item: unknown, index: number, ctx: WorkflowContext) => boolean;
108
+ /** Maximum concurrent item executions. Default: 1 */
109
+ maxConcurrency?: number;
110
+ }
111
+ interface AgentStep {
112
+ id: string;
113
+ name: string;
114
+ type: 'agent';
115
+ prompt: string | ((ctx: WorkflowContext) => string);
116
+ outputKey: string;
117
+ execute?: (ctx: WorkflowContext) => Promise<WorkflowContext>;
118
+ rollback?: (ctx: WorkflowContext) => Promise<void>;
119
+ retry?: Partial<RetryConfig>;
120
+ }
121
+ type AnyStep = WorkflowStep | ParallelStep | ConditionalStep | LoopStep | ForeachStep | MapStep | AgentStep;
122
+ interface WorkflowDefinition {
123
+ id: string;
124
+ name: string;
125
+ steps: AnyStep[];
126
+ initialContext?: WorkflowContext;
127
+ maxDurationMs?: number;
128
+ }
129
+ interface ValidationResult$1 {
130
+ valid: boolean;
131
+ errors: string[];
132
+ }
133
+ type WorkflowEventType = 'step:start' | 'step:complete' | 'step:error';
134
+ interface WorkflowEvent {
135
+ type: WorkflowEventType;
136
+ stepId: string;
137
+ stepName: string;
138
+ timestamp: number;
139
+ context?: WorkflowContext;
140
+ error?: string;
141
+ }
142
+
143
+ interface WorkflowPort {
144
+ execute(definition: WorkflowDefinition, context?: WorkflowContext): Promise<WorkflowResult>;
145
+ validate(definition: WorkflowDefinition): ValidationResult;
146
+ }
147
+ interface ValidationResult {
148
+ valid: boolean;
149
+ errors: string[];
150
+ }
151
+ type WorkflowEventListener = (event: WorkflowEvent) => void;
152
+
153
+ export type { AgentStep as A, ConditionalStep as C, ForeachStep as F, InputMapping as I, LoopStep as L, MapStep as M, OutputMapping as O, ParallelStep as P, RetryConfig as R, StepType as S, ValidationResult as V, WorkflowContext as W, WorkflowDefinition as a, WorkflowPort as b, WorkflowEventListener as c, WorkflowResult as d, AnyStep as e, WorkflowEvent as f, WorkflowEventType as g, WorkflowStep as h, ValidationResult$1 as i };
@@ -0,0 +1,153 @@
1
+ interface RetryConfig {
2
+ maxAttempts: number;
3
+ backoffMs: number;
4
+ backoffMultiplier: number;
5
+ }
6
+ type WorkflowContext = Record<string, unknown>;
7
+ interface OutputMapping {
8
+ /** Source path in the step output context */
9
+ source: string;
10
+ /** Target key in the next workflow context */
11
+ targetKey: string;
12
+ /** Optional value transform */
13
+ transform?: (value: unknown, result: WorkflowContext) => unknown;
14
+ /** Fallback value when source is missing/undefined */
15
+ defaultValue?: unknown;
16
+ }
17
+ interface InputMapping {
18
+ /** Explicit keys to project from workflow context */
19
+ keys?: string[];
20
+ /** Extract values from paths into new keys */
21
+ paths?: Record<string, string>;
22
+ /** Static default values merged first */
23
+ defaults?: Record<string, unknown>;
24
+ /** Static overrides merged last */
25
+ overrides?: Record<string, unknown>;
26
+ }
27
+ interface WorkflowStep {
28
+ id: string;
29
+ name: string;
30
+ type?: StepType;
31
+ condition?: (ctx: WorkflowContext) => boolean;
32
+ inputMapping?: InputMapping;
33
+ outputMapping?: OutputMapping[];
34
+ execute: (ctx: WorkflowContext) => Promise<WorkflowContext>;
35
+ rollback?: (ctx: WorkflowContext) => Promise<void>;
36
+ retry?: Partial<RetryConfig>;
37
+ }
38
+ interface WorkflowResult {
39
+ status: "completed" | "failed";
40
+ context: WorkflowContext;
41
+ completedSteps: string[];
42
+ skippedSteps: string[];
43
+ failedStep?: string;
44
+ error?: string;
45
+ totalDurationMs: number;
46
+ }
47
+ type StepType = 'sequential' | 'parallel' | 'conditional' | 'loop' | 'agent' | 'foreach' | 'map';
48
+ interface ParallelStep {
49
+ id: string;
50
+ name: string;
51
+ type: 'parallel';
52
+ branches: WorkflowStep[];
53
+ mergeStrategy?: 'all' | 'first' | 'race';
54
+ }
55
+ interface ConditionalStep {
56
+ id: string;
57
+ name: string;
58
+ type: 'conditional';
59
+ condition: (ctx: WorkflowContext) => boolean;
60
+ ifTrue: WorkflowStep;
61
+ ifFalse?: WorkflowStep;
62
+ }
63
+ interface LoopStep {
64
+ id: string;
65
+ name: string;
66
+ type: 'loop';
67
+ body: WorkflowStep;
68
+ condition: (ctx: WorkflowContext) => boolean;
69
+ maxIterations?: number;
70
+ }
71
+ interface ForeachStep {
72
+ id: string;
73
+ name: string;
74
+ type: 'foreach';
75
+ /** Path to iterable in context, e.g. "items" or "payload.results" */
76
+ iterable: string;
77
+ /** Step executed for each item */
78
+ step: WorkflowStep;
79
+ /** Item variable name exposed in item context. Default: "item" */
80
+ itemKey?: string;
81
+ /** Optional index variable name. Default: "index" */
82
+ indexKey?: string;
83
+ /** Aggregate output key in final context. Default: step id */
84
+ aggregateOutputKey?: string;
85
+ /** Aggregate behavior for per-item outputs. Default: "array" */
86
+ aggregationMode?: 'array' | 'concat' | 'merge';
87
+ /** Maximum concurrent item executions. Default: 1 */
88
+ maxConcurrency?: number;
89
+ /** Safety cap on iterations */
90
+ maxIterations?: number;
91
+ }
92
+ interface MapStep {
93
+ id: string;
94
+ name: string;
95
+ type: 'map';
96
+ /** Path to input array in context */
97
+ input: string;
98
+ /** Transform step executed for each item */
99
+ transform: WorkflowStep;
100
+ /** Output collection key */
101
+ outputKey: string;
102
+ /** Item variable name exposed in item context. Default: "item" */
103
+ itemKey?: string;
104
+ /** Optional index variable name. Default: "index" */
105
+ indexKey?: string;
106
+ /** Optional item filter */
107
+ filter?: (item: unknown, index: number, ctx: WorkflowContext) => boolean;
108
+ /** Maximum concurrent item executions. Default: 1 */
109
+ maxConcurrency?: number;
110
+ }
111
+ interface AgentStep {
112
+ id: string;
113
+ name: string;
114
+ type: 'agent';
115
+ prompt: string | ((ctx: WorkflowContext) => string);
116
+ outputKey: string;
117
+ execute?: (ctx: WorkflowContext) => Promise<WorkflowContext>;
118
+ rollback?: (ctx: WorkflowContext) => Promise<void>;
119
+ retry?: Partial<RetryConfig>;
120
+ }
121
+ type AnyStep = WorkflowStep | ParallelStep | ConditionalStep | LoopStep | ForeachStep | MapStep | AgentStep;
122
+ interface WorkflowDefinition {
123
+ id: string;
124
+ name: string;
125
+ steps: AnyStep[];
126
+ initialContext?: WorkflowContext;
127
+ maxDurationMs?: number;
128
+ }
129
+ interface ValidationResult$1 {
130
+ valid: boolean;
131
+ errors: string[];
132
+ }
133
+ type WorkflowEventType = 'step:start' | 'step:complete' | 'step:error';
134
+ interface WorkflowEvent {
135
+ type: WorkflowEventType;
136
+ stepId: string;
137
+ stepName: string;
138
+ timestamp: number;
139
+ context?: WorkflowContext;
140
+ error?: string;
141
+ }
142
+
143
+ interface WorkflowPort {
144
+ execute(definition: WorkflowDefinition, context?: WorkflowContext): Promise<WorkflowResult>;
145
+ validate(definition: WorkflowDefinition): ValidationResult;
146
+ }
147
+ interface ValidationResult {
148
+ valid: boolean;
149
+ errors: string[];
150
+ }
151
+ type WorkflowEventListener = (event: WorkflowEvent) => void;
152
+
153
+ export type { AgentStep as A, ConditionalStep as C, ForeachStep as F, InputMapping as I, LoopStep as L, MapStep as M, OutputMapping as O, ParallelStep as P, RetryConfig as R, StepType as S, ValidationResult as V, WorkflowContext as W, WorkflowDefinition as a, WorkflowPort as b, WorkflowEventListener as c, WorkflowResult as d, AnyStep as e, WorkflowEvent as f, WorkflowEventType as g, WorkflowStep as h, ValidationResult$1 as i };
package/package.json ADDED
@@ -0,0 +1,230 @@
1
+ {
2
+ "name": "gauss-ai",
3
+ "version": "4.0.0",
4
+ "description": "Gauss — The most complete AI agent framework for TypeScript. 57+ features including multi-agent teams, RAG, workflow DSL, voice STT/TTS, multimodal vision, MCP/A2A protocols, 40+ LLM providers, hexagonal architecture, and visual agent builder.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "keywords": [
8
+ "ai",
9
+ "agent",
10
+ "agentic",
11
+ "framework",
12
+ "llm",
13
+ "rag",
14
+ "workflow",
15
+ "middleware",
16
+ "mcp",
17
+ "tools",
18
+ "multi-agent",
19
+ "typescript",
20
+ "hexagonal-architecture",
21
+ "voice",
22
+ "multimodal",
23
+ "a2a"
24
+ ],
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/giulio-leone/gauss.git",
28
+ "directory": "gauss-flow"
29
+ },
30
+ "homepage": "https://giulio-leone.github.io/gauss/",
31
+ "bugs": {
32
+ "url": "https://github.com/giulio-leone/gauss/issues"
33
+ },
34
+ "author": "Giulio Leone <https://github.com/giulio-leone>",
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "engines": {
39
+ "node": ">=18"
40
+ },
41
+ "sideEffects": false,
42
+ "main": "./dist/index.cjs",
43
+ "module": "./dist/index.js",
44
+ "types": "./dist/index.d.ts",
45
+ "exports": {
46
+ ".": {
47
+ "types": "./dist/index.d.ts",
48
+ "import": "./dist/index.js",
49
+ "require": "./dist/index.cjs"
50
+ },
51
+ "./node": {
52
+ "types": "./dist/node/index.d.ts",
53
+ "import": "./dist/node/index.js",
54
+ "require": "./dist/node/index.cjs"
55
+ },
56
+ "./deno": {
57
+ "types": "./dist/deno/index.d.ts",
58
+ "import": "./dist/deno/index.js"
59
+ },
60
+ "./edge": {
61
+ "types": "./dist/edge/index.d.ts",
62
+ "import": "./dist/edge/index.js"
63
+ },
64
+ "./browser": {
65
+ "types": "./dist/browser/index.d.ts",
66
+ "import": "./dist/browser/index.js"
67
+ },
68
+ "./server": {
69
+ "types": "./dist/server/index.d.ts",
70
+ "import": "./dist/server/index.js"
71
+ },
72
+ "./rest": {
73
+ "types": "./dist/rest/index.d.ts",
74
+ "import": "./dist/rest/index.js",
75
+ "require": "./dist/rest/index.cjs"
76
+ },
77
+ "./scraping": {
78
+ "types": "./dist/scraping/index.d.ts",
79
+ "import": "./dist/scraping/index.js",
80
+ "require": "./dist/scraping/index.cjs"
81
+ },
82
+ "./workflow": {
83
+ "types": "./dist/workflow/index.d.ts",
84
+ "import": "./dist/workflow/index.js",
85
+ "require": "./dist/workflow/index.cjs"
86
+ },
87
+ "./a2a": {
88
+ "types": "./dist/a2a/index.d.ts",
89
+ "import": "./dist/a2a/index.js",
90
+ "require": "./dist/a2a/index.cjs"
91
+ },
92
+ "./testing": {
93
+ "types": "./dist/testing/index.d.ts",
94
+ "import": "./dist/testing/index.js",
95
+ "require": "./dist/testing/index.cjs"
96
+ },
97
+ "./plugins": {
98
+ "types": "./dist/plugins/index.d.ts",
99
+ "import": "./dist/plugins/index.js",
100
+ "require": "./dist/plugins/index.cjs"
101
+ },
102
+ "./runtime/node": {
103
+ "types": "./dist/runtime-node.d.ts",
104
+ "import": "./dist/runtime-node.js"
105
+ },
106
+ "./runtime/deno": {
107
+ "types": "./dist/runtime-deno.d.ts",
108
+ "import": "./dist/runtime-deno.js"
109
+ },
110
+ "./runtime/edge": {
111
+ "types": "./dist/runtime-edge.d.ts",
112
+ "import": "./dist/runtime-edge.js"
113
+ },
114
+ "./providers": {
115
+ "types": "./dist/providers/index.d.ts",
116
+ "import": "./dist/providers/index.js",
117
+ "require": "./dist/providers/index.cjs"
118
+ }
119
+ },
120
+ "files": [
121
+ "dist",
122
+ "README.md",
123
+ "LICENSE",
124
+ "CHANGELOG.md"
125
+ ],
126
+ "bin": {
127
+ "gauss": "./dist/cli/index.js"
128
+ },
129
+ "scripts": {
130
+ "build": "tsup",
131
+ "dev": "tsup --watch",
132
+ "check-types": "tsc --noEmit",
133
+ "test": "vitest run",
134
+ "test:watch": "vitest",
135
+ "test:quality:semantic": "vitest run src/evals/__tests__/semantic-search.quality-gate.test.ts src/evals/__tests__/semantic-search-harness.test.ts",
136
+ "test:benchmark:semantic": "vitest run src/evals/__tests__/semantic-search-benchmark.test.ts src/evals/__tests__/semantic-search.benchmark-gate.test.ts",
137
+ "test:stress:semantic": "vitest run src/evals/__tests__/semantic-search-stress-suite.test.ts src/evals/__tests__/semantic-search.stress-gate.test.ts",
138
+ "quality:gate": "npm run test:quality:semantic",
139
+ "benchmark:gate": "npm run test:benchmark:semantic",
140
+ "stress:gate": "npm run test:stress:semantic",
141
+ "prepublishOnly": "npm run build",
142
+ "clean": "rimraf dist"
143
+ },
144
+ "dependencies": {
145
+ "zod": "^3.25.76"
146
+ },
147
+ "peerDependencies": {
148
+ "@ai-sdk/anthropic": "^3.0.49",
149
+ "@ai-sdk/google": "^3.0.33",
150
+ "@ai-sdk/groq": "^3.0.25",
151
+ "@ai-sdk/mcp": "^1.0.21",
152
+ "@ai-sdk/mistral": "^3.0.20",
153
+ "@ai-sdk/openai": "^3.0.36",
154
+ "@aws-sdk/client-s3": ">=3.0.0",
155
+ "@aws-sdk/s3-request-presigner": ">=3.0.0",
156
+ "@openrouter/ai-sdk-provider": "^2.2.3",
157
+ "@supabase/supabase-js": "^2.95.3",
158
+ "bullmq": ">=5.0.0",
159
+ "ioredis": ">=5.0.0",
160
+ "pg": ">=8.0.0",
161
+ "tiktoken": "^1.0.22"
162
+ },
163
+ "peerDependenciesMeta": {
164
+ "@ai-sdk/openai": {
165
+ "optional": true
166
+ },
167
+ "@ai-sdk/anthropic": {
168
+ "optional": true
169
+ },
170
+ "@ai-sdk/google": {
171
+ "optional": true
172
+ },
173
+ "@ai-sdk/groq": {
174
+ "optional": true
175
+ },
176
+ "@ai-sdk/mistral": {
177
+ "optional": true
178
+ },
179
+ "@ai-sdk/mcp": {
180
+ "optional": true
181
+ },
182
+ "@openrouter/ai-sdk-provider": {
183
+ "optional": true
184
+ },
185
+ "@supabase/supabase-js": {
186
+ "optional": true
187
+ },
188
+ "tiktoken": {
189
+ "optional": true
190
+ },
191
+ "pg": {
192
+ "optional": true
193
+ },
194
+ "ioredis": {
195
+ "optional": true
196
+ },
197
+ "bullmq": {
198
+ "optional": true
199
+ },
200
+ "@aws-sdk/client-s3": {
201
+ "optional": true
202
+ },
203
+ "@aws-sdk/s3-request-presigner": {
204
+ "optional": true
205
+ }
206
+ },
207
+ "devDependencies": {
208
+ "@ai-sdk/anthropic": "^3.0.50",
209
+ "@ai-sdk/google": "^3.0.34",
210
+ "@ai-sdk/groq": "^3.0.26",
211
+ "@ai-sdk/mcp": "^1.0.0",
212
+ "@ai-sdk/mistral": "^3.0.21",
213
+ "@ai-sdk/openai": "^3.0.37",
214
+ "@aws-sdk/client-s3": "^3.1000.0",
215
+ "@aws-sdk/s3-request-presigner": "^3.1000.0",
216
+ "@openrouter/ai-sdk-provider": "^2.2.3",
217
+ "@supabase/supabase-js": "^2.0.0",
218
+ "@types/node": "^25.2.3",
219
+ "@types/pg": "^8.16.0",
220
+ "@vitest/coverage-v8": "^4.0.15",
221
+ "bullmq": "^5.70.1",
222
+ "ioredis": "^5.10.0",
223
+ "pg": "^8.19.0",
224
+ "rimraf": "^6.1.2",
225
+ "tiktoken": "^1.0.0",
226
+ "tsup": "^8.0.2",
227
+ "typescript": "^5.9.3",
228
+ "vitest": "^4.0.15"
229
+ }
230
+ }