@kortyx/agent 0.21.0 → 0.22.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,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.22.0](https://github.com/kortyx-io/kortyx/compare/agent-v0.21.0...agent-v0.22.0) (2026-09-14)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **errors:** public failure messages and default HTTP statuses change; malformed streams fail explicitly, provider error classes are shared, and retry helpers exclude control flow. Existing calls and legacy records remain supported. See the error-contract migration and release notes.
9
+
10
+ ### Features
11
+
12
+ * **errors:** harden failure contracts across execution and recovery ([#175](https://github.com/kortyx-io/kortyx/issues/175)) ([d231e36](https://github.com/kortyx-io/kortyx/commit/d231e364259a4f23fc3675d8783fde5ba338416e))
13
+
14
+
15
+ ### Dependencies
16
+
17
+ * The following workspace dependencies were updated
18
+ * dependencies
19
+ * @kortyx/core bumped to 0.9.0
20
+ * @kortyx/providers bumped to 0.7.0
21
+ * @kortyx/runtime bumped to 0.17.0
22
+ * @kortyx/stream bumped to 0.12.0
23
+ * @kortyx/utils bumped to 0.3.0
24
+ * devDependencies
25
+ * @kortyx/hooks bumped to 0.25.0
26
+ * @kortyx/openai bumped to 0.5.0
27
+
3
28
  ## [0.21.0](https://github.com/kortyx-io/kortyx/compare/agent-v0.20.1...agent-v0.21.0) (2026-09-11)
4
29
 
5
30
 
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { GetProviderFn } from '@kortyx/providers';
3
3
  import { PendingRequestRecord, PendingRequestStore, CheckpointSummary, CheckpointId, SessionCheckpointRecord, RollbackSessionCheckpointResult, ForkSessionCheckpointResult, WorkflowRegistry, FrameworkAdapter, ExecutionRuntimeConfig } from '@kortyx/runtime';
4
4
  import { StreamChunk } from '@kortyx/stream';
5
5
  import { z } from 'zod';
6
+ import { FailureDescriptor, KortyxError } from '@kortyx/core/errors';
6
7
  import * as _kortyx_hooks from '@kortyx/hooks';
7
8
  import { KortyxTelemetryConfig, EnsureWorkflowTopologyRequest } from '@kortyx/hooks';
8
9
  import { C as ChatMessage } from './browser-wjeg_MwV.js';
@@ -61,10 +62,7 @@ type ExecutionResult<T = Record<string, unknown>> = ExecutionInfo & ({
61
62
  reason: string;
62
63
  } | {
63
64
  status: "failed";
64
- error: {
65
- code: string;
66
- message: string;
67
- };
65
+ error: Pick<FailureDescriptor, "code" | "message"> & Partial<FailureDescriptor>;
68
66
  });
69
67
  type ExecuteOptions<W extends ExecutableWorkflow> = {
70
68
  limits?: ExecutionLimits;
@@ -82,10 +80,9 @@ type ResumeOptions<W extends ExecutableWorkflow> = {
82
80
  response: ResumeResponse;
83
81
  };
84
82
  /** The command was rejected before starting work or claiming an interrupt. */
85
- declare class ExecutionRequestError extends Error {
86
- readonly code: string;
83
+ declare class ExecutionRequestError extends KortyxError {
87
84
  name: string;
88
- constructor(code: string, message: string);
85
+ constructor(code: string, message: string, cause?: unknown);
89
86
  }
90
87
 
91
88
  declare const scopeSchema: z.ZodObject<{
@@ -206,6 +203,10 @@ type CheckpointRequestBody = {
206
203
  checkpointId: string;
207
204
  newSessionId?: string | undefined;
208
205
  };
206
+ /** Read an object-shaped API command without exposing parser/input details. */
207
+ declare function readRequestJson(request: Request): Promise<Record<string, unknown>>;
208
+ /** Safe response for custom route handlers. Control flow propagates unchanged. */
209
+ declare function createFailureResponse(error: unknown, status?: number): Response;
209
210
  declare function parseChatRequestBody(value: unknown): ChatRequestBody;
210
211
  declare function parseCheckpointRequestBody(value: unknown): CheckpointRequestBody;
211
212
  declare function handleChatRequestBody(args: {
@@ -342,4 +343,4 @@ declare function transformGraphStreamForUI(stream: AsyncIterable<StreamEvent>, o
342
343
 
343
344
  declare function extractLatestUserMessage(messages: ChatMessage[]): string;
344
345
 
345
- export { type Agent, type AgentProcessOptions, type AgentProjectTopologyOptions, type ApplyResumeSelection, ChatMessage, type ChatRequestBody, type CheckpointRequestBody, type CompiledGraphLike, type CreateAgentArgs, type ExecutableWorkflow, type ExecuteOptions, type ExecutionInfo, type ExecutionInterrupt, ExecutionRequestError, type ExecutionResult, type InterruptScope, type ListInterruptsOptions, type OrchestrateArgs, type PendingInterrupt, type ResumableInterrupt, type ResumeHandle, type ResumeMeta, type ResumeOptions, type ResumeResponse, type SaveMemoryFn, type SelectWorkflowFn, type StreamChatArgs, createAgent, createChatRouteHandler, createCheckpointRouteHandler, extractLatestUserMessage, handleChatRequestBody, handleCheckpointRequestBody, orchestrateGraphStream, parseChatRequestBody, parseCheckpointRequestBody, parseResumeMeta, projectWorkflowTopology, streamChat, transformGraphStreamForUI, tryPrepareResumeStream };
346
+ export { type Agent, type AgentProcessOptions, type AgentProjectTopologyOptions, type ApplyResumeSelection, ChatMessage, type ChatRequestBody, type CheckpointRequestBody, type CompiledGraphLike, type CreateAgentArgs, type ExecutableWorkflow, type ExecuteOptions, type ExecutionInfo, type ExecutionInterrupt, ExecutionRequestError, type ExecutionResult, type InterruptScope, type ListInterruptsOptions, type OrchestrateArgs, type PendingInterrupt, type ResumableInterrupt, type ResumeHandle, type ResumeMeta, type ResumeOptions, type ResumeResponse, type SaveMemoryFn, type SelectWorkflowFn, type StreamChatArgs, createAgent, createChatRouteHandler, createCheckpointRouteHandler, createFailureResponse, extractLatestUserMessage, handleChatRequestBody, handleCheckpointRequestBody, orchestrateGraphStream, parseChatRequestBody, parseCheckpointRequestBody, parseResumeMeta, projectWorkflowTopology, readRequestJson, streamChat, transformGraphStreamForUI, tryPrepareResumeStream };