@weaveintel/core 0.0.1

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 (266) hide show
  1. package/README.md +91 -0
  2. package/dist/a2a.d.ts +304 -0
  3. package/dist/a2a.d.ts.map +1 -0
  4. package/dist/a2a.js +68 -0
  5. package/dist/a2a.js.map +1 -0
  6. package/dist/admin-capabilities.d.ts +60 -0
  7. package/dist/admin-capabilities.d.ts.map +1 -0
  8. package/dist/admin-capabilities.js +31 -0
  9. package/dist/admin-capabilities.js.map +1 -0
  10. package/dist/agents.d.ts +214 -0
  11. package/dist/agents.d.ts.map +1 -0
  12. package/dist/agents.js +12 -0
  13. package/dist/agents.js.map +1 -0
  14. package/dist/artifacts.d.ts +70 -0
  15. package/dist/artifacts.d.ts.map +1 -0
  16. package/dist/artifacts.js +5 -0
  17. package/dist/artifacts.js.map +1 -0
  18. package/dist/cache.d.ts +177 -0
  19. package/dist/cache.d.ts.map +1 -0
  20. package/dist/cache.js +9 -0
  21. package/dist/cache.js.map +1 -0
  22. package/dist/callables.d.ts +34 -0
  23. package/dist/callables.d.ts.map +1 -0
  24. package/dist/callables.js +35 -0
  25. package/dist/callables.js.map +1 -0
  26. package/dist/capabilities.d.ts +77 -0
  27. package/dist/capabilities.d.ts.map +1 -0
  28. package/dist/capabilities.js +82 -0
  29. package/dist/capabilities.js.map +1 -0
  30. package/dist/capability-policy.d.ts +41 -0
  31. package/dist/capability-policy.d.ts.map +1 -0
  32. package/dist/capability-policy.js +34 -0
  33. package/dist/capability-policy.js.map +1 -0
  34. package/dist/collaboration.d.ts +45 -0
  35. package/dist/collaboration.d.ts.map +1 -0
  36. package/dist/collaboration.js +5 -0
  37. package/dist/collaboration.js.map +1 -0
  38. package/dist/compliance.d.ts +71 -0
  39. package/dist/compliance.d.ts.map +1 -0
  40. package/dist/compliance.js +5 -0
  41. package/dist/compliance.js.map +1 -0
  42. package/dist/connectors.d.ts +109 -0
  43. package/dist/connectors.d.ts.map +1 -0
  44. package/dist/connectors.js +24 -0
  45. package/dist/connectors.js.map +1 -0
  46. package/dist/context.d.ts +52 -0
  47. package/dist/context.d.ts.map +1 -0
  48. package/dist/context.js +70 -0
  49. package/dist/context.js.map +1 -0
  50. package/dist/contracts.d.ts +70 -0
  51. package/dist/contracts.d.ts.map +1 -0
  52. package/dist/contracts.js +5 -0
  53. package/dist/contracts.js.map +1 -0
  54. package/dist/documents.d.ts +55 -0
  55. package/dist/documents.d.ts.map +1 -0
  56. package/dist/documents.js +9 -0
  57. package/dist/documents.js.map +1 -0
  58. package/dist/error-classifier.d.ts +67 -0
  59. package/dist/error-classifier.d.ts.map +1 -0
  60. package/dist/error-classifier.js +129 -0
  61. package/dist/error-classifier.js.map +1 -0
  62. package/dist/errors.d.ts +27 -0
  63. package/dist/errors.d.ts.map +1 -0
  64. package/dist/errors.js +63 -0
  65. package/dist/errors.js.map +1 -0
  66. package/dist/evals.d.ts +55 -0
  67. package/dist/evals.d.ts.map +1 -0
  68. package/dist/evals.js +9 -0
  69. package/dist/evals.js.map +1 -0
  70. package/dist/events.d.ts +60 -0
  71. package/dist/events.d.ts.map +1 -0
  72. package/dist/events.js +108 -0
  73. package/dist/events.js.map +1 -0
  74. package/dist/extraction.d.ts +71 -0
  75. package/dist/extraction.d.ts.map +1 -0
  76. package/dist/extraction.js +5 -0
  77. package/dist/extraction.js.map +1 -0
  78. package/dist/files.d.ts +39 -0
  79. package/dist/files.d.ts.map +1 -0
  80. package/dist/files.js +9 -0
  81. package/dist/files.js.map +1 -0
  82. package/dist/finetuning.d.ts +58 -0
  83. package/dist/finetuning.d.ts.map +1 -0
  84. package/dist/finetuning.js +9 -0
  85. package/dist/finetuning.js.map +1 -0
  86. package/dist/graph.d.ts +70 -0
  87. package/dist/graph.d.ts.map +1 -0
  88. package/dist/graph.js +5 -0
  89. package/dist/graph.js.map +1 -0
  90. package/dist/guardrails.d.ts +221 -0
  91. package/dist/guardrails.d.ts.map +1 -0
  92. package/dist/guardrails.js +2 -0
  93. package/dist/guardrails.js.map +1 -0
  94. package/dist/hardened-fetch.d.ts +80 -0
  95. package/dist/hardened-fetch.d.ts.map +1 -0
  96. package/dist/hardened-fetch.js +251 -0
  97. package/dist/hardened-fetch.js.map +1 -0
  98. package/dist/human-tasks.d.ts +141 -0
  99. package/dist/human-tasks.d.ts.map +1 -0
  100. package/dist/human-tasks.js +5 -0
  101. package/dist/human-tasks.js.map +1 -0
  102. package/dist/identity.d.ts +53 -0
  103. package/dist/identity.d.ts.map +1 -0
  104. package/dist/identity.js +5 -0
  105. package/dist/identity.js.map +1 -0
  106. package/dist/index.d.ts +66 -0
  107. package/dist/index.d.ts.map +1 -0
  108. package/dist/index.js +163 -0
  109. package/dist/index.js.map +1 -0
  110. package/dist/json-patch.d.ts +72 -0
  111. package/dist/json-patch.d.ts.map +1 -0
  112. package/dist/json-patch.js +239 -0
  113. package/dist/json-patch.js.map +1 -0
  114. package/dist/logger.d.ts +29 -0
  115. package/dist/logger.d.ts.map +1 -0
  116. package/dist/logger.js +74 -0
  117. package/dist/logger.js.map +1 -0
  118. package/dist/managed-vectorstore.d.ts +88 -0
  119. package/dist/managed-vectorstore.d.ts.map +1 -0
  120. package/dist/managed-vectorstore.js +10 -0
  121. package/dist/managed-vectorstore.js.map +1 -0
  122. package/dist/mcp.d.ts +195 -0
  123. package/dist/mcp.d.ts.map +1 -0
  124. package/dist/mcp.js +9 -0
  125. package/dist/mcp.js.map +1 -0
  126. package/dist/memory.d.ts +152 -0
  127. package/dist/memory.d.ts.map +1 -0
  128. package/dist/memory.js +10 -0
  129. package/dist/memory.js.map +1 -0
  130. package/dist/middleware.d.ts +40 -0
  131. package/dist/middleware.d.ts.map +1 -0
  132. package/dist/middleware.js +79 -0
  133. package/dist/middleware.js.map +1 -0
  134. package/dist/models.d.ts +279 -0
  135. package/dist/models.d.ts.map +1 -0
  136. package/dist/models.js +12 -0
  137. package/dist/models.js.map +1 -0
  138. package/dist/moderation.d.ts +39 -0
  139. package/dist/moderation.d.ts.map +1 -0
  140. package/dist/moderation.js +10 -0
  141. package/dist/moderation.js.map +1 -0
  142. package/dist/net-guard.d.ts +60 -0
  143. package/dist/net-guard.d.ts.map +1 -0
  144. package/dist/net-guard.js +250 -0
  145. package/dist/net-guard.js.map +1 -0
  146. package/dist/notifications.d.ts +121 -0
  147. package/dist/notifications.d.ts.map +1 -0
  148. package/dist/notifications.js +12 -0
  149. package/dist/notifications.js.map +1 -0
  150. package/dist/observability-runtime.d.ts +16 -0
  151. package/dist/observability-runtime.d.ts.map +1 -0
  152. package/dist/observability-runtime.js +34 -0
  153. package/dist/observability-runtime.js.map +1 -0
  154. package/dist/observability.d.ts +130 -0
  155. package/dist/observability.d.ts.map +1 -0
  156. package/dist/observability.js +9 -0
  157. package/dist/observability.js.map +1 -0
  158. package/dist/plugins.d.ts +46 -0
  159. package/dist/plugins.d.ts.map +1 -0
  160. package/dist/plugins.js +5 -0
  161. package/dist/plugins.js.map +1 -0
  162. package/dist/prompts.d.ts +219 -0
  163. package/dist/prompts.d.ts.map +1 -0
  164. package/dist/prompts.js +5 -0
  165. package/dist/prompts.js.map +1 -0
  166. package/dist/registry.d.ts +31 -0
  167. package/dist/registry.d.ts.map +1 -0
  168. package/dist/registry.js +34 -0
  169. package/dist/registry.js.map +1 -0
  170. package/dist/reliability.d.ts +68 -0
  171. package/dist/reliability.d.ts.map +1 -0
  172. package/dist/reliability.js +5 -0
  173. package/dist/reliability.js.map +1 -0
  174. package/dist/replay.d.ts +91 -0
  175. package/dist/replay.d.ts.map +1 -0
  176. package/dist/replay.js +5 -0
  177. package/dist/replay.js.map +1 -0
  178. package/dist/responses.d.ts +273 -0
  179. package/dist/responses.d.ts.map +1 -0
  180. package/dist/responses.js +11 -0
  181. package/dist/responses.js.map +1 -0
  182. package/dist/routing.d.ts +171 -0
  183. package/dist/routing.d.ts.map +1 -0
  184. package/dist/routing.js +5 -0
  185. package/dist/routing.js.map +1 -0
  186. package/dist/run-events.d.ts +199 -0
  187. package/dist/run-events.d.ts.map +1 -0
  188. package/dist/run-events.js +88 -0
  189. package/dist/run-events.js.map +1 -0
  190. package/dist/run-journal.d.ts +66 -0
  191. package/dist/run-journal.d.ts.map +1 -0
  192. package/dist/run-journal.js +153 -0
  193. package/dist/run-journal.js.map +1 -0
  194. package/dist/run-registry.d.ts +49 -0
  195. package/dist/run-registry.d.ts.map +1 -0
  196. package/dist/run-registry.js +154 -0
  197. package/dist/run-registry.js.map +1 -0
  198. package/dist/run-substrate-contract.d.ts +48 -0
  199. package/dist/run-substrate-contract.d.ts.map +1 -0
  200. package/dist/run-substrate-contract.js +124 -0
  201. package/dist/run-substrate-contract.js.map +1 -0
  202. package/dist/runs.d.ts +94 -0
  203. package/dist/runs.d.ts.map +1 -0
  204. package/dist/runs.js +12 -0
  205. package/dist/runs.js.map +1 -0
  206. package/dist/runtime.d.ts +665 -0
  207. package/dist/runtime.d.ts.map +1 -0
  208. package/dist/runtime.js +436 -0
  209. package/dist/runtime.js.map +1 -0
  210. package/dist/sandbox.d.ts +50 -0
  211. package/dist/sandbox.d.ts.map +1 -0
  212. package/dist/sandbox.js +5 -0
  213. package/dist/sandbox.js.map +1 -0
  214. package/dist/secrets.d.ts +34 -0
  215. package/dist/secrets.d.ts.map +1 -0
  216. package/dist/secrets.js +68 -0
  217. package/dist/secrets.js.map +1 -0
  218. package/dist/security.d.ts +97 -0
  219. package/dist/security.d.ts.map +1 -0
  220. package/dist/security.js +9 -0
  221. package/dist/security.js.map +1 -0
  222. package/dist/sse-parser.d.ts +67 -0
  223. package/dist/sse-parser.d.ts.map +1 -0
  224. package/dist/sse-parser.js +156 -0
  225. package/dist/sse-parser.js.map +1 -0
  226. package/dist/sse-writer.d.ts +63 -0
  227. package/dist/sse-writer.d.ts.map +1 -0
  228. package/dist/sse-writer.js +87 -0
  229. package/dist/sse-writer.js.map +1 -0
  230. package/dist/surface-catalog.d.ts +68 -0
  231. package/dist/surface-catalog.d.ts.map +1 -0
  232. package/dist/surface-catalog.js +13 -0
  233. package/dist/surface-catalog.js.map +1 -0
  234. package/dist/tenancy.d.ts +67 -0
  235. package/dist/tenancy.d.ts.map +1 -0
  236. package/dist/tenancy.js +5 -0
  237. package/dist/tenancy.js.map +1 -0
  238. package/dist/tool-lifecycle.d.ts +118 -0
  239. package/dist/tool-lifecycle.d.ts.map +1 -0
  240. package/dist/tool-lifecycle.js +5 -0
  241. package/dist/tool-lifecycle.js.map +1 -0
  242. package/dist/tools.d.ts +96 -0
  243. package/dist/tools.d.ts.map +1 -0
  244. package/dist/tools.js +71 -0
  245. package/dist/tools.js.map +1 -0
  246. package/dist/triggers.d.ts +48 -0
  247. package/dist/triggers.d.ts.map +1 -0
  248. package/dist/triggers.js +5 -0
  249. package/dist/triggers.js.map +1 -0
  250. package/dist/ui-events.d.ts +96 -0
  251. package/dist/ui-events.d.ts.map +1 -0
  252. package/dist/ui-events.js +5 -0
  253. package/dist/ui-events.js.map +1 -0
  254. package/dist/uuid.d.ts +27 -0
  255. package/dist/uuid.d.ts.map +1 -0
  256. package/dist/uuid.js +54 -0
  257. package/dist/uuid.js.map +1 -0
  258. package/dist/vectorstore.d.ts +76 -0
  259. package/dist/vectorstore.d.ts.map +1 -0
  260. package/dist/vectorstore.js +9 -0
  261. package/dist/vectorstore.js.map +1 -0
  262. package/dist/workflows.d.ts +554 -0
  263. package/dist/workflows.d.ts.map +1 -0
  264. package/dist/workflows.js +29 -0
  265. package/dist/workflows.js.map +1 -0
  266. package/package.json +33 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.js","sourceRoot":"","sources":["../src/uuid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAE/B,8CAA8C;IAC9C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CAAC,CAAC,CAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,CAAC;IAEjH,OAAO;QACL,IAAI,CAAC,MAAM,CAAC,EAA2B,kCAAkC;QACzE,IAAI,CAAC,KAAK,CAAC,EAA4B,qCAAqC;QAC5E,IAAI,CAAC,IAAI,CAAC,EAA6B,iCAAiC;QACxE,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,EAAM,uCAAuC;QAC9E,IAAI,EAAmC,+BAA+B;KACvE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @weaveintel/core — Vector store & retrieval contracts
3
+ *
4
+ * Why: Retrieval is independent of agents — it works standalone. The contracts
5
+ * separate storage (VectorStore) from retrieval strategy (Retriever) so you
6
+ * can compose different strategies without changing storage backends.
7
+ */
8
+ import type { HasCapabilities } from './capabilities.js';
9
+ import type { ExecutionContext } from './context.js';
10
+ import type { DocumentChunk } from './documents.js';
11
+ export interface VectorStoreConfig {
12
+ readonly name: string;
13
+ readonly dimensions: number;
14
+ readonly metric?: 'cosine' | 'euclidean' | 'dotProduct';
15
+ readonly namespace?: string;
16
+ }
17
+ export interface VectorRecord {
18
+ readonly id: string;
19
+ readonly embedding: readonly number[];
20
+ readonly content: string;
21
+ readonly metadata: Record<string, unknown>;
22
+ }
23
+ export interface VectorSearchOptions {
24
+ readonly embedding: readonly number[];
25
+ readonly topK: number;
26
+ readonly filter?: Record<string, unknown>;
27
+ readonly minScore?: number;
28
+ readonly includeMetadata?: boolean;
29
+ readonly namespace?: string;
30
+ }
31
+ export interface VectorSearchResult {
32
+ readonly id: string;
33
+ readonly score: number;
34
+ readonly content: string;
35
+ readonly metadata: Record<string, unknown>;
36
+ }
37
+ export interface VectorStore extends HasCapabilities {
38
+ readonly config: VectorStoreConfig;
39
+ upsert(ctx: ExecutionContext, records: VectorRecord[]): Promise<void>;
40
+ search(ctx: ExecutionContext, options: VectorSearchOptions): Promise<VectorSearchResult[]>;
41
+ delete(ctx: ExecutionContext, ids: string[]): Promise<void>;
42
+ count?(ctx: ExecutionContext): Promise<number>;
43
+ }
44
+ export interface RetrievalQuery {
45
+ readonly query: string;
46
+ readonly topK?: number;
47
+ readonly filter?: Record<string, unknown>;
48
+ readonly minScore?: number;
49
+ readonly rerank?: boolean;
50
+ }
51
+ export interface RetrievalResult {
52
+ readonly chunks: readonly DocumentChunk[];
53
+ readonly query: string;
54
+ readonly metadata?: Record<string, unknown>;
55
+ }
56
+ export interface Retriever {
57
+ retrieve(ctx: ExecutionContext, query: RetrievalQuery): Promise<RetrievalResult>;
58
+ }
59
+ export type ChunkingStrategy = 'fixed_size' | 'token_aware' | 'semantic_boundary' | 'heading_aware' | 'code_aware' | 'table_aware' | 'adaptive';
60
+ export interface ChunkerConfig {
61
+ readonly strategy: ChunkingStrategy;
62
+ readonly chunkSize?: number;
63
+ readonly chunkOverlap?: number;
64
+ readonly maxChunks?: number;
65
+ }
66
+ export interface Chunker {
67
+ chunk(content: string, config?: Partial<ChunkerConfig>): DocumentChunk[];
68
+ }
69
+ export interface IndexerConfig {
70
+ readonly batchSize?: number;
71
+ readonly parallelism?: number;
72
+ }
73
+ export interface Indexer {
74
+ index(ctx: ExecutionContext, chunks: DocumentChunk[]): Promise<void>;
75
+ }
76
+ //# sourceMappingURL=vectorstore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vectorstore.d.ts","sourceRoot":"","sources":["../src/vectorstore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,E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AS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,EAAE,CAAC;CAC1E;AAID,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @weaveintel/core — Vector store & retrieval contracts
3
+ *
4
+ * Why: Retrieval is independent of agents — it works standalone. The contracts
5
+ * separate storage (VectorStore) from retrieval strategy (Retriever) so you
6
+ * can compose different strategies without changing storage backends.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=vectorstore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vectorstore.js","sourceRoot":"","sources":["../src/vectorstore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,554 @@
1
+ /**
2
+ * @weaveintel/core — Workflow orchestration contracts
3
+ */
4
+ export type WorkflowStepType = 'deterministic' | 'agentic' | 'branch' | 'loop' | 'condition' | 'wait' | 'parallel' | 'sub-workflow' | 'human-task' | 'switch' | 'forEach' | 'fork' | 'join' | 'dynamic';
5
+ export interface WorkflowStep {
6
+ id: string;
7
+ name: string;
8
+ type: WorkflowStepType;
9
+ description?: string;
10
+ /**
11
+ * Handler reference. Three accepted forms:
12
+ * 1. Bare key (e.g. `'echo'`) — looked up in the engine's registered handler map.
13
+ * 2. Resolver-prefixed (e.g. `'tool:foo'`, `'prompt:bar'`, `'agent:baz'`,
14
+ * `'mcp:server:method'`, `'script:slug'`, `'subworkflow:wf-key'`,
15
+ * `'noop'`) — built into a runnable StepHandler at run-start time
16
+ * by the matching `HandlerResolver`.
17
+ * 3. Omitted — falls back to the step `id` as the handler key.
18
+ */
19
+ handler?: string;
20
+ config?: Record<string, unknown>;
21
+ next?: string | string[];
22
+ condition?: string;
23
+ timeout?: number;
24
+ retries?: number;
25
+ /** Milliseconds to wait between retry attempts. */
26
+ retryDelayMs?: number;
27
+ /**
28
+ * Phase 1 — Declarative input mapping.
29
+ * Keys are paths into the *handler input object* (the `variables` arg
30
+ * the handler receives). Values are dotted paths into the live
31
+ * `WorkflowState.variables`. When set, the engine builds a fresh input
32
+ * object from these mappings instead of passing the entire `variables`
33
+ * object through. Example:
34
+ * { "competitionId": "kaggle.activeCompetition.id",
35
+ * "topic": "input.topic" }
36
+ */
37
+ inputMap?: Record<string, string>;
38
+ /**
39
+ * Phase W1 — Error boundary. If this step fails (and all retries are
40
+ * exhausted), execution jumps to this step ID instead of triggering global
41
+ * saga compensation. The error is available as `__error` in variables.
42
+ */
43
+ onError?: string;
44
+ /**
45
+ * Phase W1 — Skip condition. JSONLogic-ish expression evaluated against
46
+ * `state.variables`. If truthy the step is skipped; execution advances to
47
+ * `next` without running the handler.
48
+ */
49
+ skipIf?: unknown;
50
+ /**
51
+ * Exponential backoff multiplier applied to `retryDelayMs` per attempt.
52
+ * delay = min(retryDelayMs × multiplier^attempt, retryMaxDelayMs). Default 2.
53
+ */
54
+ retryBackoffMultiplier?: number;
55
+ /** Cap on the computed exponential delay (ms). Default 30 000. */
56
+ retryMaxDelayMs?: number;
57
+ /** Add ±25 % random jitter to each retry delay to prevent thundering herd. Default false. */
58
+ retryJitter?: boolean;
59
+ /**
60
+ * Total time budget (ms) across ALL retry attempts combined. When the
61
+ * elapsed time since the first failure reaches this value, no further
62
+ * retries are attempted.
63
+ */
64
+ globalTimeoutMs?: number;
65
+ /**
66
+ * Idempotency key expression (same JSONLogic syntax as skipIf). Evaluated
67
+ * against `state.variables`. If a cached output exists for `stepId:keyValue`,
68
+ * the handler is skipped and the cached output is replayed. Cache is
69
+ * populated on successful handler completion.
70
+ */
71
+ idempotencyKey?: unknown;
72
+ /**
73
+ * Fallback handler key. When all retries are exhausted, this handler is
74
+ * invoked instead of triggering onError/compensation. Its output is treated
75
+ * as the step's successful output. If the fallback also throws, onError /
76
+ * compensation logic takes over.
77
+ */
78
+ fallbackHandler?: string;
79
+ /**
80
+ * Phase W1 — Declarative output mapping.
81
+ * Keys are dotted paths into `WorkflowState.variables` to write into.
82
+ * Values are dotted paths into the handler's *return value*.
83
+ * Example: { "kaggle.lastRunId": "id", "kaggle.lastStatus": "status" }
84
+ */
85
+ outputMap?: Record<string, string>;
86
+ /**
87
+ * JSON-Schema-lite object to validate the step's output after completion.
88
+ * Supports the same narrow subset as inputSchema: type, required,
89
+ * properties, enum.
90
+ */
91
+ outputSchema?: Record<string, unknown>;
92
+ /**
93
+ * Action taken when `outputSchema` validation fails.
94
+ * 'warn' — emit `step:output_schema_warn` event, continue (default).
95
+ * 'fail' — mark step as failed with a schema error message.
96
+ * 'coerce' — attempt type coercion on mismatched fields, then continue.
97
+ */
98
+ outputSchemaAction?: 'warn' | 'fail' | 'coerce';
99
+ /**
100
+ * Top-level field names in the step output to redact before the output is
101
+ * written to run state, checkpoints, or event payloads.
102
+ * Supports dot-notation for nested paths (e.g. `"auth.token"`).
103
+ */
104
+ maskFields?: string[];
105
+ /**
106
+ * Controls where the step output is stored after completion.
107
+ * 'global' (default) — written to `state.variables.__step_{id}` and persisted.
108
+ * 'step' — written to `state.ephemeralVariables.__step_{id}` only;
109
+ * available to the next step but NOT checkpointed or
110
+ * written to the durable run record.
111
+ */
112
+ outputScope?: 'global' | 'step';
113
+ /**
114
+ * Phase W4 — Durable sleep duration for `wait` steps (milliseconds).
115
+ * When set on a `wait` step the engine schedules an automatic `resumeRun()`
116
+ * after this many milliseconds instead of requiring an external call.
117
+ * The wakeAt timestamp is persisted so it survives process restarts.
118
+ */
119
+ wakeAfterMs?: number;
120
+ }
121
+ /**
122
+ * Phase 4 — Mesh ↔ workflow binding.
123
+ * Declarative output contract: when a run reaches `completed`, the engine
124
+ * emits a typed contract via the configured `ContractEmitter`. The body is
125
+ * built from `bodyMap` (keys = dotted paths into the contract body, values
126
+ * = dotted paths into `WorkflowState.variables` — same semantics as
127
+ * `outputMap` on a step). When `evidence.fromHistory` is true, the
128
+ * full step history is attached as evidence.
129
+ */
130
+ export interface WorkflowOutputContract {
131
+ kind: string;
132
+ bodyMap?: Record<string, string>;
133
+ evidence?: {
134
+ fromHistory?: boolean;
135
+ };
136
+ meshId?: string;
137
+ metadata?: Record<string, unknown>;
138
+ }
139
+ export interface WorkflowDefinition {
140
+ id: string;
141
+ name: string;
142
+ version: string;
143
+ description?: string;
144
+ steps: WorkflowStep[];
145
+ entryStepId: string;
146
+ metadata?: Record<string, unknown>;
147
+ /** Phase 4 — emit a typed mesh contract on successful completion. */
148
+ outputContract?: WorkflowOutputContract;
149
+ /**
150
+ * Phase 5 — Optional JSON-Schema-lite shape describing the expected
151
+ * `input` for `engine.startRun(workflowId, input)`. When set, the
152
+ * engine validates the input before creating a run and rejects
153
+ * malformed inputs with a structured error. Supports a deliberately
154
+ * narrow subset: `type` (string/number/boolean/object/array/null),
155
+ * `required`, `properties`, `enum`. See input-validator.ts.
156
+ */
157
+ inputSchema?: Record<string, unknown>;
158
+ createdAt?: string;
159
+ updatedAt?: string;
160
+ }
161
+ export type WorkflowRunStatus = 'pending' | 'running' | 'paused' | 'completed' | 'failed' | 'cancelled';
162
+ export interface WorkflowState {
163
+ currentStepId: string;
164
+ variables: Record<string, unknown>;
165
+ history: WorkflowStepResult[];
166
+ checkpointId?: string;
167
+ /**
168
+ * Phase W3 — Ephemeral step-local variables.
169
+ * Populated when a step runs with `outputScope: 'step'`. Available to the
170
+ * immediately following step handler but NOT persisted to checkpoints or
171
+ * the run repository. Cleared at the start of every step.
172
+ */
173
+ ephemeralVariables?: Record<string, unknown>;
174
+ }
175
+ export interface WorkflowStepResult {
176
+ stepId: string;
177
+ status: 'completed' | 'failed' | 'skipped';
178
+ output?: unknown;
179
+ error?: string;
180
+ startedAt: string;
181
+ completedAt: string;
182
+ }
183
+ export interface WorkflowRun {
184
+ id: string;
185
+ workflowId: string;
186
+ status: WorkflowRunStatus;
187
+ state: WorkflowState;
188
+ startedAt: string;
189
+ completedAt?: string;
190
+ error?: string;
191
+ /**
192
+ * Phase 5 — Cumulative cost (USD) attributed to this run by the engine's
193
+ * `CostMeter`. Updated at every step boundary. Persisted by repositories
194
+ * that support a `cost_total` column.
195
+ */
196
+ costTotal?: number;
197
+ /**
198
+ * Phase W3 — Distributed trace ID propagated through all steps.
199
+ * Generated at run start if not supplied by the caller.
200
+ */
201
+ traceId?: string;
202
+ /**
203
+ * Phase W3 — Tenant identifier for multi-tenant deployments.
204
+ * Forwarded into `__ctx` on every step handler invocation.
205
+ */
206
+ tenantId?: string;
207
+ /**
208
+ * Phase W4 — ID of the parent run that spawned this run as a sub-workflow.
209
+ * Set automatically when the engine starts a child run via the subworkflow
210
+ * resolver; used for depth-first cancellation propagation.
211
+ */
212
+ parentRunId?: string;
213
+ /**
214
+ * Phase W4 — IDs of all direct child sub-workflow runs spawned by this run.
215
+ * Used by `cancelRun()` to cascade cancellation depth-first.
216
+ */
217
+ childRunIds?: string[];
218
+ /**
219
+ * Phase W5 — Run priority (0–9, higher = higher priority). Used when the
220
+ * concurrency limit is reached and runs are buffered in the run queue.
221
+ */
222
+ priority?: number;
223
+ /**
224
+ * Phase W5 — Per-handler-key cost accumulation. Step outputs that include a
225
+ * top-level `__cost: number` field have that value extracted and added here
226
+ * under the step's handler key. Enables per-resolver-kind cost visibility
227
+ * beyond the global `costTotal` ceiling check.
228
+ */
229
+ costBreakdown?: Record<string, number>;
230
+ /**
231
+ * Phase W7 — Immutable snapshot of the workflow definition captured at
232
+ * `startRun` time. The engine uses this for all step lookups and routing
233
+ * during the run, so edits to the live definition store after the run starts
234
+ * have no effect on in-flight execution or replay. Persisted by the run
235
+ * repository so it survives process restarts.
236
+ */
237
+ definitionSnapshot?: WorkflowDefinition;
238
+ /**
239
+ * Phase W7 — Steps appended to the run's effective graph at runtime by
240
+ * `dynamic` steps. Stored on the run and checkpointed so sub-graph
241
+ * execution is restart-safe.
242
+ */
243
+ dynamicSteps?: WorkflowStep[];
244
+ /**
245
+ * Phase W7 — Number of times a `dynamic` step has spliced a sub-graph into
246
+ * this run. Used to enforce `policy.maxExpansionDepth`.
247
+ */
248
+ expansionDepth?: number;
249
+ }
250
+ /**
251
+ * Phase W3 — Execution context injected as `__ctx` into every step's
252
+ * variables map. Enables handlers to forward correlation IDs to downstream
253
+ * services without manually threading them through workflow input.
254
+ */
255
+ export interface StepContext {
256
+ traceId: string;
257
+ tenantId?: string;
258
+ runId: string;
259
+ stepId: string;
260
+ /** 1-based attempt number; > 1 on retries. */
261
+ attempt: number;
262
+ }
263
+ export interface WorkflowCheckpoint {
264
+ id: string;
265
+ runId: string;
266
+ /** ID of the workflow definition this run belongs to. Required for post-restart recovery. */
267
+ workflowId?: string;
268
+ stepId: string;
269
+ state: WorkflowState;
270
+ createdAt: string;
271
+ }
272
+ export type WorkflowTriggerType = 'manual' | 'cron' | 'event' | 'webhook';
273
+ export interface WorkflowTrigger {
274
+ id: string;
275
+ workflowId: string;
276
+ type: WorkflowTriggerType;
277
+ config: Record<string, unknown>;
278
+ enabled: boolean;
279
+ }
280
+ export interface WorkflowScheduler {
281
+ schedule(trigger: WorkflowTrigger): Promise<void>;
282
+ cancel(triggerId: string): Promise<void>;
283
+ list(workflowId: string): Promise<WorkflowTrigger[]>;
284
+ }
285
+ export interface WorkflowPolicy {
286
+ maxDuration?: number;
287
+ maxSteps?: number;
288
+ maxRetries?: number;
289
+ requireApprovalForSteps?: string[];
290
+ costCeiling?: number;
291
+ /**
292
+ * Phase W3 — Maximum number of bytes (JSON-serialised) a step output may
293
+ * occupy inline in `state.variables`. Outputs exceeding this threshold are
294
+ * offloaded to the configured `PayloadStore` and replaced by a reference
295
+ * object `{ __payloadRef: key }`. Default: unlimited (no offload).
296
+ */
297
+ maxInlineBytes?: number;
298
+ /**
299
+ * Phase W5 — Maximum number of simultaneously active (running or paused)
300
+ * runs for this workflow definition. When the limit is reached, `startRun()`
301
+ * throws `WorkflowConcurrencyError` unless a `runQueue` is configured on the
302
+ * engine, in which case the run is buffered and started as capacity frees.
303
+ */
304
+ maxConcurrentRuns?: number;
305
+ /**
306
+ * Phase W5 — Maximum number of new runs that may be started per minute for
307
+ * this workflow definition. Enforced via a per-definition token bucket.
308
+ * Exceeding this limit causes `startRun()` to throw `WorkflowRateLimitError`.
309
+ */
310
+ maxRunsPerMinute?: number;
311
+ /**
312
+ * Phase W7 — Allowlist of handler kinds that generated steps (from `dynamic`
313
+ * expansions) may use. Defaults to `['noop', 'tool', 'prompt', 'agent', 'mcp']`
314
+ * when not set. `'script'` and `'subworkflow'` are intentionally excluded by
315
+ * default; add them explicitly if your threat model allows it.
316
+ */
317
+ dynamicHandlerKinds?: string[];
318
+ /**
319
+ * Phase W7 — Maximum total number of steps that may be generated across all
320
+ * `dynamic` expansions within a single run. Enforced by `validateExpansion`.
321
+ */
322
+ maxGeneratedSteps?: number;
323
+ /**
324
+ * Phase W7 — Maximum number of `dynamic` step expansions permitted per run
325
+ * (i.e., the maximum value of `run.expansionDepth`). Default: 5.
326
+ */
327
+ maxExpansionDepth?: number;
328
+ }
329
+ /**
330
+ * Phase W7 — The value returned by a `dynamic` step's handler.
331
+ * The engine splices `steps` into the run's effective graph and immediately
332
+ * routes execution into `entry`. When the sub-graph terminates, control
333
+ * returns to `rejoin` (or the dynamic step's `next` if `rejoin` is omitted).
334
+ */
335
+ export interface DynamicExpansion {
336
+ /** Steps to append to the run's effective graph. IDs must not collide with existing steps. */
337
+ steps: WorkflowStep[];
338
+ /** ID of the first step to execute in the generated sub-graph. Must be in `steps`. */
339
+ entry: string;
340
+ /**
341
+ * Step ID to jump to when the generated sub-graph terminates (its final step
342
+ * has no `next`). Defaults to the `dynamic` step's own `next` when omitted.
343
+ */
344
+ rejoin?: string;
345
+ }
346
+ export interface WorkflowCompensation {
347
+ stepId: string;
348
+ handler: string;
349
+ description?: string;
350
+ }
351
+ export type WorkflowEventType = 'workflow:started' | 'workflow:completed' | 'workflow:failed' | 'workflow:paused' | 'workflow:contract_emitted' | 'workflow:cost_exceeded' | 'step:started' | 'step:completed' | 'step:failed' | 'step:output_schema_warn' | 'step:payload_offloaded' | 'approval:requested' | 'approval:received' | 'step:locked' | 'step:replayed' | 'run:sleep_scheduled' | 'run:sleep_resumed' | 'run:cancelled_child';
352
+ export interface WorkflowEvent {
353
+ type: WorkflowEventType;
354
+ runId: string;
355
+ stepId?: string;
356
+ timestamp: string;
357
+ data?: unknown;
358
+ }
359
+ /**
360
+ * Immutable append-only record of a single workflow engine state transition.
361
+ * Written by the engine on every step start/complete/fail, run start/complete/fail,
362
+ * sleep, resume, and cancellation. Forms a causal history of the run.
363
+ */
364
+ export interface WorkflowAuditEvent {
365
+ id: string;
366
+ runId: string;
367
+ workflowId: string;
368
+ type: string;
369
+ stepId?: string;
370
+ timestamp: string;
371
+ traceId?: string;
372
+ tenantId?: string;
373
+ /** ID of the event that directly triggered this one (e.g. step:locked → step:replayed). */
374
+ causedBy?: string;
375
+ data?: Record<string, unknown>;
376
+ }
377
+ export interface WorkflowAuditLog {
378
+ append(event: Omit<WorkflowAuditEvent, 'id'>): Promise<void>;
379
+ list(runId: string): Promise<WorkflowAuditEvent[]>;
380
+ listAll(opts?: {
381
+ workflowId?: string;
382
+ limit?: number;
383
+ }): Promise<WorkflowAuditEvent[]>;
384
+ }
385
+ export interface SleepRecord {
386
+ runId: string;
387
+ wakeAt: number;
388
+ createdAt: string;
389
+ }
390
+ export interface DurableSleepStore {
391
+ schedule(runId: string, wakeAt: number): Promise<void>;
392
+ cancel(runId: string): Promise<void>;
393
+ getDue(now?: number): Promise<SleepRecord[]>;
394
+ list(): Promise<SleepRecord[]>;
395
+ }
396
+ /** Thrown by `startRun()` when `policy.maxConcurrentRuns` is exceeded and no run queue is configured. */
397
+ export declare class WorkflowConcurrencyError extends Error {
398
+ readonly workflowId: string;
399
+ readonly activeCount: number;
400
+ readonly limit: number;
401
+ constructor(workflowId: string, activeCount: number, limit: number);
402
+ }
403
+ /** Thrown by `startRun()` when `policy.maxRunsPerMinute` token bucket is exhausted. */
404
+ export declare class WorkflowRateLimitError extends Error {
405
+ readonly workflowId: string;
406
+ readonly limitPerMinute: number;
407
+ constructor(workflowId: string, limitPerMinute: number);
408
+ }
409
+ export type ApprovalStatus = 'pending' | 'approved' | 'rejected' | 'expired';
410
+ export interface WorkflowApprovalTask {
411
+ id: string;
412
+ runId: string;
413
+ stepId: string;
414
+ description: string;
415
+ status: ApprovalStatus;
416
+ assignee?: string;
417
+ data?: unknown;
418
+ decision?: unknown;
419
+ createdAt: string;
420
+ decidedAt?: string;
421
+ }
422
+ export interface WorkflowEngine {
423
+ createDefinition(def: WorkflowDefinition): Promise<WorkflowDefinition>;
424
+ getDefinition(id: string): Promise<WorkflowDefinition | null>;
425
+ listDefinitions(): Promise<WorkflowDefinition[]>;
426
+ startRun(workflowId: string, input?: Record<string, unknown>, opts?: {
427
+ traceId?: string;
428
+ tenantId?: string;
429
+ parentRunId?: string;
430
+ priority?: number;
431
+ }): Promise<WorkflowRun>;
432
+ getRun(runId: string): Promise<WorkflowRun | null>;
433
+ resumeRun(runId: string, data?: unknown): Promise<WorkflowRun>;
434
+ cancelRun(runId: string): Promise<void>;
435
+ listRuns(workflowId?: string): WorkflowRun[];
436
+ /**
437
+ * Recover a run after process restart by replaying from the latest checkpoint.
438
+ * Returns null if no checkpoint exists for the given runId.
439
+ */
440
+ recoverRun(runId: string): Promise<WorkflowRun | null>;
441
+ /**
442
+ * Phase W4 — Return the full immutable audit event history for a run.
443
+ * Returns an empty array when no audit log is configured.
444
+ */
445
+ listWorkflowEvents(runId: string): Promise<WorkflowAuditEvent[]>;
446
+ /**
447
+ * Phase W6 — Return a full execution trace for a run (spans + summary).
448
+ * Returns null if the run does not exist.
449
+ */
450
+ getRunTrace(runId: string): Promise<RunTrace | null>;
451
+ /**
452
+ * Phase W6 — Re-execute a run from scratch (or from a specific step),
453
+ * optionally overriding specific step outputs. Returns the new run.
454
+ */
455
+ replayRun(runId: string, opts?: ReplayRunOpts): Promise<WorkflowRun>;
456
+ }
457
+ /** Status a span can report. */
458
+ export type SpanStatus = 'completed' | 'failed' | 'skipped' | 'paused';
459
+ /**
460
+ * A single step execution record emitted by the engine after each step.
461
+ * Modelled after OpenTelemetry spans — `startedAt`/`completedAt` are Unix ms.
462
+ */
463
+ export interface WorkflowSpan {
464
+ runId: string;
465
+ workflowId: string;
466
+ stepId: string;
467
+ /** Resolver kind: 'noop' | 'tool' | 'script' | 'agent' | 'prompt' | 'mcp' | 'subworkflow' | step.type */
468
+ handlerKind: string;
469
+ /** The raw handler string (e.g. 'tool:web.search' or the step ID for inline). */
470
+ handlerKey: string;
471
+ startedAt: number;
472
+ completedAt: number;
473
+ durationMs: number;
474
+ status: SpanStatus;
475
+ /** Number of retry attempts made (0 = no retries). */
476
+ retryCount: number;
477
+ /** Cost in USD contributed by this step (from __cost extraction). */
478
+ costUsd: number;
479
+ /** Error message if status === 'failed'. */
480
+ error?: string;
481
+ /** Arbitrary key-value attributes (traceId, tenantId, etc.). */
482
+ attributes: Record<string, string | number | boolean>;
483
+ }
484
+ /**
485
+ * Full execution trace for a workflow run — spans ordered by execution,
486
+ * plus summary metadata.
487
+ */
488
+ export interface RunTrace {
489
+ runId: string;
490
+ workflowId: string;
491
+ status: WorkflowRunStatus;
492
+ startedAt: string;
493
+ completedAt?: string;
494
+ totalDurationMs: number;
495
+ costTotal: number;
496
+ costBreakdown: Record<string, number>;
497
+ spans: WorkflowSpan[];
498
+ }
499
+ /** Emitter interface — apps plug in memory, file, or DB backends. */
500
+ export interface WorkflowSpanEmitter {
501
+ emit(span: WorkflowSpan): void | Promise<void>;
502
+ getSpans(runId: string): Promise<WorkflowSpan[]>;
503
+ getAllSpans(): Promise<WorkflowSpan[]>;
504
+ clear(runId: string): Promise<void>;
505
+ }
506
+ /** Severity of a linter finding. */
507
+ export type LintSeverity = 'error' | 'warning' | 'info';
508
+ /** A single finding from `lintWorkflow()`. */
509
+ export interface LintResult {
510
+ severity: LintSeverity;
511
+ /** The step ID the finding applies to, if any. */
512
+ stepId?: string;
513
+ message: string;
514
+ /** Machine-readable rule identifier. */
515
+ rule: string;
516
+ }
517
+ /** A workflow adjacency list suitable for rendering a visual graph. */
518
+ export interface WorkflowGraphNode {
519
+ id: string;
520
+ name: string;
521
+ type: WorkflowStepType;
522
+ handler?: string;
523
+ isEntry: boolean;
524
+ isTerminal: boolean;
525
+ }
526
+ export interface WorkflowGraphEdge {
527
+ from: string;
528
+ to: string;
529
+ /** Edge label — 'true'/'false' for condition, case value for branch/switch. */
530
+ label?: string;
531
+ }
532
+ export interface WorkflowGraph {
533
+ nodes: WorkflowGraphNode[];
534
+ edges: WorkflowGraphEdge[];
535
+ entryStepId: string;
536
+ /** Step IDs unreachable from the entry step. */
537
+ unreachableStepIds: string[];
538
+ }
539
+ /** Options for `replayRun()`. */
540
+ export interface ReplayRunOpts {
541
+ /**
542
+ * Re-execute from this step onward using live handlers.
543
+ * Steps before this step replay their recorded outputs from the run history.
544
+ */
545
+ fromStepId?: string;
546
+ /**
547
+ * Per-step output overrides. Key = stepId, value = the output to inject.
548
+ * Takes precedence over both recorded history and live handlers.
549
+ */
550
+ overrides?: Record<string, unknown>;
551
+ /** Tenant ID for the new replay run (defaults to original run's tenantId). */
552
+ tenantId?: string;
553
+ }
554
+ //# sourceMappingURL=workflows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../src/workflows.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,MAAM,gBAAgB,GAC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