kortyx 0.22.0 → 0.23.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/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.23.0](https://github.com/kortyx-io/kortyx/compare/kortyx-v0.22.1...kortyx-v0.23.0) (2026-09-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * **observability:** report handled workflow errors ([#222](https://github.com/kortyx-io/kortyx/issues/222)) ([68a3b0e](https://github.com/kortyx-io/kortyx/commit/68a3b0eea5d93cb89bdcef63c4767f3b0d59e60d))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @kortyx/agent bumped to 0.25.1
16
+ * @kortyx/cli bumped to 0.10.1
17
+ * @kortyx/hooks bumped to 0.27.0
18
+ * @kortyx/runtime bumped to 0.20.1
19
+
20
+ ## [0.22.1](https://github.com/kortyx-io/kortyx/compare/kortyx-v0.22.0...kortyx-v0.22.1) (2026-09-19)
21
+
22
+
23
+ ### Dependencies
24
+
25
+ * The following workspace dependencies were updated
26
+ * dependencies
27
+ * @kortyx/cli bumped to 0.10.0
28
+
3
29
  ## [0.22.0](https://github.com/kortyx-io/kortyx/compare/kortyx-v0.21.0...kortyx-v0.22.0) (2026-09-18)
4
30
 
5
31
 
package/README.md CHANGED
@@ -263,6 +263,8 @@ Apache-2.0. See [LICENSE](https://github.com/kortyx-io/kortyx/blob/main/LICENSE)
263
263
 
264
264
  Use `serializeFailure` for safe structured diagnostics and `DomainError` for explicitly approved domain details that must survive child checkpoint restore. Cancellation, execution limits and human interrupts remain control flow. Applications own retry and schema correction policy. See the [error handling guide](../../apps/website/src/docs/v0/03-guides/08-error-handling.md).
265
265
 
266
+ Throw ordinary `Error` instances when a workflow cannot continue; configured tracing records them automatically before the run fails. Use `reportError(error, {severity?, metadata?, tags?})` only for handled errors when application code deliberately continues with a fallback. Reporting is best-effort observation and never changes workflow control flow.
267
+
266
268
  ## Shared tools
267
269
 
268
270
  `await useTool({tool, input})` executes a typed plain tool immediately inside a workflow node, without a model call or MCP transport. Pass the same definition to `useReason({tools: [tool]})` for model-driven selection and arguments. Tool definitions can provide `outcomes.denialCodes`, `classifyResult` and `classifyError`; permission enforcement remains application-owned. Direct calls preserve result/error identity and do not cache executions.
@@ -270,4 +272,4 @@ Use `serializeFailure` for safe structured diagnostics and `DomainError` for exp
270
272
  Studio records individual durations and separate success, denial, fault and cancellation outcomes; cached native and child calls appear as reuse with their original scope. Tool faults automatically include error type and message (up to 256/8192 characters), without extra call-site wiring. Observations exclude raw inputs/results, exception objects, causes and stacks. Error messages are exported verbatim and can contain sensitive text; an optional tool `telemetry.error(error)` callback can replace them with `{type, message}` or return `null` to suppress them. Throwing projections suppress diagnostics and never alter execution. Observer and delivery failures cannot change execution. `kortyx topology push` discovers attached tools from source, marks dynamic attachments unresolved, and makes available tools visible before traffic.
271
273
 
272
274
 
273
- Configured Studio/OpenTelemetry tracing also captures model provider failures and `useReason` output-parsing failures automatically, including bounded error type/message. No extra wiring is needed. Studio opens the failed model event and displays reasoning/output failures separately when the model response itself completed normally. Prompts, outputs, exception stacks/causes and raw provider responses are excluded by default. Messages are verbatim; the optional trace adapter `error(error)` override can return `{type, message}` or `null` to replace/suppress model diagnostics without changing execution. Client-facing failure contracts remain unchanged.
275
+ Configured Studio/OpenTelemetry tracing captures thrown workflow/model errors automatically, including bounded type, message, stack and cause details. Studio also records manual `reportError` calls as handled errors without failing the span. Prompts, outputs and raw provider responses remain excluded by default. Diagnostics are verbatim and may contain sensitive text; the optional trace adapter `error(error)` override can return `{type, message, stack?, cause?}` or `null` to replace or suppress them without changing execution. Client-facing failure contracts remain sanitized and unchanged.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from '@kortyx/core/errors';
2
2
  export { Agent, AgentProcessOptions, ChatRequestBody, CheckpointRequestBody, CreateAgentArgs, ExecutableWorkflow, ExecuteOptions, ExecutionInfo, ExecutionInterrupt, ExecutionRequestError, ExecutionResult, InterruptScope, ListInterruptsOptions, PendingInterrupt, ResumableInterrupt, ResumeHandle, ResumeOptions, ResumeResponse, StreamChatFromRouteArgs, createAgent, createChatRouteHandler, createCheckpointRouteHandler, createFailureResponse, handleChatRequestBody, handleCheckpointRequestBody, parseChatRequestBody, parseCheckpointRequestBody, readRequestJson, streamChatFromRoute } from '@kortyx/agent';
3
3
  export { ExecutionLimit, ExecutionLimitReached, ExecutionLimits, GraphState, NodeConfig, NodeContext, NodeFn, NodeHandler, NodeResult, RuntimeEnvelope, WorkflowDefinition, WorkflowId, defineWorkflow, loadWorkflow, validateWorkflow } from '@kortyx/core';
4
- export { CompleteResponseOptions, EnsureWorkflowTopologyRequest, EnsureWorkflowTopologyResponse, KortyxErrorDetails, KortyxTelemetryConfig, KortyxTelemetryContentCapture, KortyxTelemetryCorrelation, KortyxTelemetryEvent, KortyxTelemetryEventType, KortyxTelemetryPrompt, KortyxTelemetryReporter, KortyxTelemetryService, KortyxTraceAdapter, KortyxTraceErrorProjection, KortyxTraceMetadata, ParallelError, UseInterruptArgs, UseReasonArgs, UseReasonResult, UseReasonStep, UseReasonToolExecution, UseStructuredDataArgs, UseToolArgs, WorkflowCallError, completeResponse, createWorkflowHooks, parallel, useAbortSignal, useInterrupt, useNodeState, useReason, useRuntimeContext, useStructuredData, useTool, useWorkflow, useWorkflowState } from '@kortyx/hooks';
4
+ export { CompleteResponseOptions, EnsureWorkflowTopologyRequest, EnsureWorkflowTopologyResponse, KortyxErrorDetails, KortyxTelemetryConfig, KortyxTelemetryContentCapture, KortyxTelemetryCorrelation, KortyxTelemetryEvent, KortyxTelemetryEventType, KortyxTelemetryPrompt, KortyxTelemetryReporter, KortyxTelemetryService, KortyxTraceAdapter, KortyxTraceErrorProjection, KortyxTraceMetadata, ParallelError, ReportErrorOptions, UseInterruptArgs, UseReasonArgs, UseReasonResult, UseReasonStep, UseReasonToolExecution, UseStructuredDataArgs, UseToolArgs, WorkflowCallError, completeResponse, createWorkflowHooks, parallel, reportError, useAbortSignal, useInterrupt, useNodeState, useReason, useRuntimeContext, useStructuredData, useTool, useWorkflow, useWorkflowState } from '@kortyx/hooks';
5
5
  export { CreateMCPClientArgs, MCPClient, McpToolsArgs, McpTransportConfig, createMCPClient } from '@kortyx/mcp';
6
6
  export * from '@kortyx/providers';
7
7
  export { CreateCachingFrameworkAdapterOptions, CreatePostgresFrameworkAdapterOptions, FrameworkAdapter, ManagedFrameworkAdapter, PostgresFrameworkAdapter, PruneRuntimeOptions, PruneRuntimeResult, RuntimeMaintenance, RuntimeRetentionPolicy, WorkflowRegistry, clearRegisteredNodes, createCachingFrameworkAdapter, createFileWorkflowRegistry, createFrameworkAdapterFromEnv, createInMemoryFrameworkAdapter, createInMemoryWorkflowRegistry, createPostgresFrameworkAdapter, createRedisFrameworkAdapter, getRegisteredNode, listRegisteredNodes, registerNode } from '@kortyx/runtime';
package/dist/index.js CHANGED
@@ -57,6 +57,7 @@ __export(index_exports, {
57
57
  readStream: () => import_stream.readStream,
58
58
  reduceStructuredChunks: () => import_stream.reduceStructuredChunks,
59
59
  registerNode: () => import_runtime.registerNode,
60
+ reportError: () => import_hooks.reportError,
60
61
  streamChatFromRoute: () => import_agent.streamChatFromRoute,
61
62
  summarizeStreamChunks: () => import_stream.summarizeStreamChunks,
62
63
  toSSE: () => import_stream.toSSE,
@@ -119,6 +120,7 @@ var import_stream = require("@kortyx/stream");
119
120
  readStream,
120
121
  reduceStructuredChunks,
121
122
  registerNode,
123
+ reportError,
122
124
  streamChatFromRoute,
123
125
  summarizeStreamChunks,
124
126
  toSSE,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"@kortyx/core/errors\";\n// release-test: 2026-01-22\n// Public DX surface for the Kortyx framework.\n\nexport type {\n Agent,\n AgentProcessOptions,\n ChatRequestBody,\n CheckpointRequestBody,\n CreateAgentArgs,\n ExecutableWorkflow,\n ExecuteOptions,\n ExecutionInfo,\n ExecutionInterrupt,\n ExecutionResult,\n InterruptScope,\n ListInterruptsOptions,\n PendingInterrupt,\n ResumableInterrupt,\n ResumeHandle,\n ResumeOptions,\n ResumeResponse,\n StreamChatFromRouteArgs,\n} from \"@kortyx/agent\";\nexport {\n createAgent,\n createChatRouteHandler,\n createCheckpointRouteHandler,\n createFailureResponse,\n ExecutionRequestError,\n handleChatRequestBody,\n handleCheckpointRequestBody,\n parseChatRequestBody,\n parseCheckpointRequestBody,\n readRequestJson,\n streamChatFromRoute,\n} from \"@kortyx/agent\";\nexport type {\n ExecutionLimit,\n ExecutionLimitReached,\n ExecutionLimits,\n GraphState,\n NodeConfig,\n NodeContext,\n NodeFn,\n NodeHandler,\n NodeResult,\n RuntimeEnvelope,\n WorkflowDefinition,\n WorkflowId,\n} from \"@kortyx/core\";\nexport { defineWorkflow, loadWorkflow, validateWorkflow } from \"@kortyx/core\";\nexport type {\n EnsureWorkflowTopologyRequest,\n EnsureWorkflowTopologyResponse,\n KortyxErrorDetails,\n KortyxTelemetryConfig,\n KortyxTelemetryContentCapture,\n KortyxTelemetryCorrelation,\n KortyxTelemetryEvent,\n KortyxTelemetryEventType,\n KortyxTelemetryPrompt,\n KortyxTelemetryReporter,\n KortyxTelemetryService,\n KortyxTraceAdapter,\n KortyxTraceErrorProjection,\n KortyxTraceMetadata,\n UseInterruptArgs,\n UseReasonArgs,\n UseReasonResult,\n UseReasonStep,\n UseReasonToolExecution,\n UseStructuredDataArgs,\n UseToolArgs,\n} from \"@kortyx/hooks\";\nexport {\n type CompleteResponseOptions,\n completeResponse,\n createWorkflowHooks,\n ParallelError,\n parallel,\n useAbortSignal,\n useInterrupt,\n useNodeState,\n useReason,\n useRuntimeContext,\n useStructuredData,\n useTool,\n useWorkflow,\n useWorkflowState,\n WorkflowCallError,\n} from \"@kortyx/hooks\";\nexport type {\n CreateMCPClientArgs,\n MCPClient,\n McpToolsArgs,\n McpTransportConfig,\n} from \"@kortyx/mcp\";\nexport { createMCPClient } from \"@kortyx/mcp\";\nexport * from \"@kortyx/providers\";\nexport type {\n CreateCachingFrameworkAdapterOptions,\n CreatePostgresFrameworkAdapterOptions,\n FrameworkAdapter,\n ManagedFrameworkAdapter,\n PostgresFrameworkAdapter,\n PruneRuntimeOptions,\n PruneRuntimeResult,\n RuntimeMaintenance,\n RuntimeRetentionPolicy,\n WorkflowRegistry,\n} from \"@kortyx/runtime\";\nexport {\n clearRegisteredNodes,\n createCachingFrameworkAdapter,\n createFileWorkflowRegistry,\n createFrameworkAdapterFromEnv,\n createInMemoryFrameworkAdapter,\n createInMemoryWorkflowRegistry,\n createPostgresFrameworkAdapter,\n createRedisFrameworkAdapter,\n getRegisteredNode,\n listRegisteredNodes,\n registerNode,\n} from \"@kortyx/runtime\";\nexport type {\n BufferedStreamResult,\n ConsumeStreamHandlers,\n StreamChunk,\n StructuredDataChunk,\n StructuredStreamAccumulator,\n StructuredStreamState,\n} from \"@kortyx/stream\";\nexport {\n applyStructuredChunk,\n collectBufferedStream,\n collectStream,\n consumeStream,\n createStreamResponse,\n createStructuredStreamAccumulator,\n readStream,\n reduceStructuredChunks,\n summarizeStreamChunks,\n toSSE,\n} from \"@kortyx/stream\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,gCAAd;AAwBA,mBAYO;AAeP,kBAA+D;AAwB/D,mBAgBO;AAOP,iBAAgC;AAChC,0BAAc,8BAnGd;AAgHA,qBAYO;AASP,oBAWO;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"@kortyx/core/errors\";\n// release-test: 2026-01-22\n// Public DX surface for the Kortyx framework.\n\nexport type {\n Agent,\n AgentProcessOptions,\n ChatRequestBody,\n CheckpointRequestBody,\n CreateAgentArgs,\n ExecutableWorkflow,\n ExecuteOptions,\n ExecutionInfo,\n ExecutionInterrupt,\n ExecutionResult,\n InterruptScope,\n ListInterruptsOptions,\n PendingInterrupt,\n ResumableInterrupt,\n ResumeHandle,\n ResumeOptions,\n ResumeResponse,\n StreamChatFromRouteArgs,\n} from \"@kortyx/agent\";\nexport {\n createAgent,\n createChatRouteHandler,\n createCheckpointRouteHandler,\n createFailureResponse,\n ExecutionRequestError,\n handleChatRequestBody,\n handleCheckpointRequestBody,\n parseChatRequestBody,\n parseCheckpointRequestBody,\n readRequestJson,\n streamChatFromRoute,\n} from \"@kortyx/agent\";\nexport type {\n ExecutionLimit,\n ExecutionLimitReached,\n ExecutionLimits,\n GraphState,\n NodeConfig,\n NodeContext,\n NodeFn,\n NodeHandler,\n NodeResult,\n RuntimeEnvelope,\n WorkflowDefinition,\n WorkflowId,\n} from \"@kortyx/core\";\nexport { defineWorkflow, loadWorkflow, validateWorkflow } from \"@kortyx/core\";\nexport type {\n EnsureWorkflowTopologyRequest,\n EnsureWorkflowTopologyResponse,\n KortyxErrorDetails,\n KortyxTelemetryConfig,\n KortyxTelemetryContentCapture,\n KortyxTelemetryCorrelation,\n KortyxTelemetryEvent,\n KortyxTelemetryEventType,\n KortyxTelemetryPrompt,\n KortyxTelemetryReporter,\n KortyxTelemetryService,\n KortyxTraceAdapter,\n KortyxTraceErrorProjection,\n KortyxTraceMetadata,\n ReportErrorOptions,\n UseInterruptArgs,\n UseReasonArgs,\n UseReasonResult,\n UseReasonStep,\n UseReasonToolExecution,\n UseStructuredDataArgs,\n UseToolArgs,\n} from \"@kortyx/hooks\";\nexport {\n type CompleteResponseOptions,\n completeResponse,\n createWorkflowHooks,\n ParallelError,\n parallel,\n reportError,\n useAbortSignal,\n useInterrupt,\n useNodeState,\n useReason,\n useRuntimeContext,\n useStructuredData,\n useTool,\n useWorkflow,\n useWorkflowState,\n WorkflowCallError,\n} from \"@kortyx/hooks\";\nexport type {\n CreateMCPClientArgs,\n MCPClient,\n McpToolsArgs,\n McpTransportConfig,\n} from \"@kortyx/mcp\";\nexport { createMCPClient } from \"@kortyx/mcp\";\nexport * from \"@kortyx/providers\";\nexport type {\n CreateCachingFrameworkAdapterOptions,\n CreatePostgresFrameworkAdapterOptions,\n FrameworkAdapter,\n ManagedFrameworkAdapter,\n PostgresFrameworkAdapter,\n PruneRuntimeOptions,\n PruneRuntimeResult,\n RuntimeMaintenance,\n RuntimeRetentionPolicy,\n WorkflowRegistry,\n} from \"@kortyx/runtime\";\nexport {\n clearRegisteredNodes,\n createCachingFrameworkAdapter,\n createFileWorkflowRegistry,\n createFrameworkAdapterFromEnv,\n createInMemoryFrameworkAdapter,\n createInMemoryWorkflowRegistry,\n createPostgresFrameworkAdapter,\n createRedisFrameworkAdapter,\n getRegisteredNode,\n listRegisteredNodes,\n registerNode,\n} from \"@kortyx/runtime\";\nexport type {\n BufferedStreamResult,\n ConsumeStreamHandlers,\n StreamChunk,\n StructuredDataChunk,\n StructuredStreamAccumulator,\n StructuredStreamState,\n} from \"@kortyx/stream\";\nexport {\n applyStructuredChunk,\n collectBufferedStream,\n collectStream,\n consumeStream,\n createStreamResponse,\n createStructuredStreamAccumulator,\n readStream,\n reduceStructuredChunks,\n summarizeStreamChunks,\n toSSE,\n} from \"@kortyx/stream\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,gCAAd;AAwBA,mBAYO;AAeP,kBAA+D;AAyB/D,mBAiBO;AAOP,iBAAgC;AAChC,0BAAc,8BArGd;AAkHA,qBAYO;AASP,oBAWO;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kortyx",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "private": false,
5
5
  "description": "TypeScript framework for production AI agents with explicit workflows, provider-agnostic models, streaming, interrupts, and runtime persistence.",
6
6
  "keywords": [
@@ -43,15 +43,15 @@
43
43
  "CHANGELOG.md"
44
44
  ],
45
45
  "dependencies": {
46
- "@kortyx/agent": "0.25.0",
47
- "@kortyx/cli": "0.9.0",
46
+ "@kortyx/agent": "0.25.1",
47
+ "@kortyx/cli": "0.10.1",
48
48
  "@kortyx/core": "0.9.0",
49
- "@kortyx/mcp": "0.2.4",
50
- "@kortyx/hooks": "0.26.0",
49
+ "@kortyx/hooks": "0.27.0",
51
50
  "@kortyx/providers": "0.8.0",
51
+ "@kortyx/mcp": "0.2.4",
52
52
  "@kortyx/utils": "0.3.0",
53
- "@kortyx/runtime": "0.20.0",
54
- "@kortyx/stream": "0.12.0"
53
+ "@kortyx/stream": "0.12.0",
54
+ "@kortyx/runtime": "0.20.1"
55
55
  },
56
56
  "devDependencies": {
57
57
  "turbo": "2.6.1",