kortyx 0.10.0 → 0.10.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.
- package/CHANGELOG.md +12 -0
- package/README.md +183 -6
- package/package.json +13 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.10.1](https://github.com/kortyx-io/kortyx/compare/kortyx-v0.10.0...kortyx-v0.10.1) (2026-05-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* The following workspace dependencies were updated
|
|
9
|
+
* dependencies
|
|
10
|
+
* @kortyx/agent bumped to 0.11.1
|
|
11
|
+
* @kortyx/core bumped to 0.5.3
|
|
12
|
+
* @kortyx/hooks bumped to 0.12.1
|
|
13
|
+
* @kortyx/runtime bumped to 0.9.4
|
|
14
|
+
|
|
3
15
|
## [0.10.0](https://github.com/kortyx-io/kortyx/compare/kortyx-v0.9.3...kortyx-v0.10.0) (2026-05-20)
|
|
4
16
|
|
|
5
17
|
|
package/README.md
CHANGED
|
@@ -1,20 +1,197 @@
|
|
|
1
1
|
# kortyx
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/kortyx)
|
|
4
|
+
[](https://github.com/kortyx-io/kortyx/actions/workflows/ci.yml)
|
|
5
|
+
[](https://github.com/kortyx-io/kortyx/blob/main/LICENSE)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](https://github.com/kortyx-io/kortyx/blob/main/package.json)
|
|
8
|
+
|
|
9
|
+
**Kortyx is a TypeScript framework for building production AI agents with explicit workflows, provider-agnostic models, typed hooks, streaming, interrupts, and runtime persistence.**
|
|
10
|
+
|
|
11
|
+
Use `kortyx` as the main package. It re-exports the public server/runtime APIs from the supporting `@kortyx/*` packages so application code can stay focused on workflows, nodes, providers, and UI transport.
|
|
4
12
|
|
|
5
13
|
## Install
|
|
6
14
|
|
|
7
15
|
```bash
|
|
8
|
-
|
|
16
|
+
pnpm add kortyx @kortyx/google @kortyx/react
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install kortyx @kortyx/google @kortyx/react
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quickstart
|
|
24
|
+
|
|
25
|
+
Create a workflow:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
// src/workflows/general-chat.workflow.ts
|
|
29
|
+
import { defineWorkflow } from "kortyx";
|
|
30
|
+
import { chatNode } from "@/nodes/chat.node";
|
|
31
|
+
|
|
32
|
+
export const generalChatWorkflow = defineWorkflow({
|
|
33
|
+
id: "general-chat",
|
|
34
|
+
version: "1.0.0",
|
|
35
|
+
description: "Single-node chat workflow.",
|
|
36
|
+
nodes: {
|
|
37
|
+
chat: {
|
|
38
|
+
run: chatNode,
|
|
39
|
+
params: {
|
|
40
|
+
temperature: 0.3,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
edges: [
|
|
45
|
+
["__start__", "chat"],
|
|
46
|
+
["chat", "__end__"],
|
|
47
|
+
],
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Add a server-side node:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
// src/nodes/chat.node.ts
|
|
55
|
+
import { google } from "@kortyx/google";
|
|
56
|
+
import { useReason } from "kortyx";
|
|
57
|
+
|
|
58
|
+
type ChatParams = {
|
|
59
|
+
temperature?: number;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const chatNode = async ({
|
|
63
|
+
input,
|
|
64
|
+
params,
|
|
65
|
+
}: {
|
|
66
|
+
input: unknown;
|
|
67
|
+
params: ChatParams;
|
|
68
|
+
}) => {
|
|
69
|
+
const result = await useReason({
|
|
70
|
+
id: "chat",
|
|
71
|
+
model: google("gemini-2.5-flash"),
|
|
72
|
+
system: "You are a concise assistant.",
|
|
73
|
+
input: String(input ?? ""),
|
|
74
|
+
temperature: params.temperature ?? 0.3,
|
|
75
|
+
stream: true,
|
|
76
|
+
emit: true,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
data: { text: result.text },
|
|
81
|
+
};
|
|
82
|
+
};
|
|
9
83
|
```
|
|
10
84
|
|
|
85
|
+
Wire the agent:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
// src/lib/agent.ts
|
|
89
|
+
import { createAgent } from "kortyx";
|
|
90
|
+
import { generalChatWorkflow } from "@/workflows/general-chat.workflow";
|
|
91
|
+
|
|
92
|
+
export const agent = createAgent({
|
|
93
|
+
workflows: [generalChatWorkflow],
|
|
94
|
+
defaultWorkflowId: "general-chat",
|
|
95
|
+
});
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Expose it through a Next.js API route:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { createChatRouteHandler } from "kortyx";
|
|
102
|
+
import { agent } from "@/lib/agent";
|
|
103
|
+
|
|
104
|
+
export const runtime = "nodejs";
|
|
105
|
+
export const dynamic = "force-dynamic";
|
|
106
|
+
|
|
107
|
+
const handleChat = createChatRouteHandler({ agent });
|
|
108
|
+
|
|
109
|
+
export async function POST(request: Request): Promise<Response> {
|
|
110
|
+
return handleChat(request);
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Consume the stream from React:
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
"use client";
|
|
118
|
+
|
|
119
|
+
import { createRouteChatTransport, useChat } from "@kortyx/react";
|
|
120
|
+
|
|
121
|
+
export function Chat() {
|
|
122
|
+
const chat = useChat({
|
|
123
|
+
transport: createRouteChatTransport({ endpoint: "/api/chat" }),
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
<form
|
|
128
|
+
onSubmit={(event) => {
|
|
129
|
+
event.preventDefault();
|
|
130
|
+
const form = new FormData(event.currentTarget);
|
|
131
|
+
chat.send(String(form.get("message") ?? ""));
|
|
132
|
+
event.currentTarget.reset();
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
{chat.messages.map((message) => (
|
|
136
|
+
<p key={message.id}>{message.content}</p>
|
|
137
|
+
))}
|
|
138
|
+
{chat.streamContentPieces.map((piece) =>
|
|
139
|
+
piece.type === "text" ? (
|
|
140
|
+
<span key={piece.id}>{piece.content}</span>
|
|
141
|
+
) : null,
|
|
142
|
+
)}
|
|
143
|
+
<input name="message" />
|
|
144
|
+
<button type="submit" disabled={chat.isStreaming}>
|
|
145
|
+
Send
|
|
146
|
+
</button>
|
|
147
|
+
</form>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Set a provider key and run your app:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
GOOGLE_API_KEY=your_key_here pnpm dev
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## API Groups
|
|
159
|
+
|
|
160
|
+
| Area | Exports |
|
|
161
|
+
| --- | --- |
|
|
162
|
+
| Agent | `createAgent`, `createChatRouteHandler`, `streamChatFromRoute` |
|
|
163
|
+
| Workflows | `defineWorkflow`, `loadWorkflow`, `validateWorkflow` |
|
|
164
|
+
| Hooks | `useReason`, `useInterrupt`, `useStructuredData`, `useNodeState`, `useWorkflowState`, `useRuntimeContext` |
|
|
165
|
+
| Runtime | workflow registries, node registry, in-memory/Redis framework adapters |
|
|
166
|
+
| Providers | provider contracts and registry helpers from `@kortyx/providers` |
|
|
167
|
+
| Streams | SSE helpers, stream readers, collectors, structured reducers |
|
|
168
|
+
|
|
169
|
+
## Provider Packages
|
|
170
|
+
|
|
171
|
+
Install only the provider integrations your app needs.
|
|
172
|
+
|
|
173
|
+
| Provider | Package | Factory | Default environment variable |
|
|
174
|
+
| --- | --- | --- | --- |
|
|
175
|
+
| Google Gemini | `@kortyx/google` | `google(...)` | `GOOGLE_API_KEY` or `GEMINI_API_KEY` |
|
|
176
|
+
| OpenAI | `@kortyx/openai` | `openai(...)` | `OPENAI_API_KEY` |
|
|
177
|
+
| Anthropic | `@kortyx/anthropic` | `anthropic(...)` | `ANTHROPIC_API_KEY` |
|
|
178
|
+
| DeepSeek | `@kortyx/deepseek` | `deepseek(...)` | `DEEPSEEK_API_KEY` |
|
|
179
|
+
| Groq | `@kortyx/groq` | `groq(...)` | `GROQ_API_KEY` |
|
|
180
|
+
| Mistral | `@kortyx/mistral` | `mistral(...)` | `MISTRAL_API_KEY` |
|
|
181
|
+
|
|
11
182
|
## Documentation
|
|
12
183
|
|
|
13
|
-
|
|
184
|
+
- [Monorepo](https://github.com/kortyx-io/kortyx)
|
|
185
|
+
- [Documentation](https://kortyx.io/docs)
|
|
186
|
+
- [Package overview](https://kortyx.io/docs/reference/package-overview)
|
|
187
|
+
- [Quickstart: Next.js API Route](https://kortyx.io/docs/getting-started/quickstart-nextjs)
|
|
188
|
+
- [Runtime persistence](https://kortyx.io/docs/production/persistence)
|
|
189
|
+
- [Provider guide](https://kortyx.io/docs/kortyx-providers/choose-a-provider)
|
|
14
190
|
|
|
15
|
-
|
|
191
|
+
## Studio
|
|
16
192
|
|
|
17
|
-
|
|
193
|
+
Kortyx Studio is on the way for cost tracking, logs, observability, prompt tracking, and operational review.
|
|
18
194
|
|
|
19
|
-
|
|
195
|
+
## License
|
|
20
196
|
|
|
197
|
+
Apache-2.0. See [LICENSE](https://github.com/kortyx-io/kortyx/blob/main/LICENSE).
|
package/package.json
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kortyx",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "TypeScript framework for production AI agents with explicit workflows, provider-agnostic models, streaming, interrupts, and runtime persistence.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"ai",
|
|
8
8
|
"agent",
|
|
9
9
|
"agents",
|
|
10
|
+
"llm",
|
|
10
11
|
"orchestration",
|
|
11
12
|
"framework",
|
|
13
|
+
"workflow",
|
|
14
|
+
"streaming",
|
|
15
|
+
"typescript",
|
|
16
|
+
"human-in-the-loop",
|
|
12
17
|
"kortyx"
|
|
13
18
|
],
|
|
14
19
|
"license": "Apache-2.0",
|
|
@@ -35,13 +40,13 @@
|
|
|
35
40
|
"CHANGELOG.md"
|
|
36
41
|
],
|
|
37
42
|
"dependencies": {
|
|
38
|
-
"@kortyx/agent": "0.11.
|
|
39
|
-
"@kortyx/core": "0.5.
|
|
40
|
-
"@kortyx/hooks": "0.12.
|
|
41
|
-
"@kortyx/runtime": "0.9.
|
|
43
|
+
"@kortyx/agent": "0.11.1",
|
|
44
|
+
"@kortyx/core": "0.5.3",
|
|
45
|
+
"@kortyx/hooks": "0.12.1",
|
|
46
|
+
"@kortyx/runtime": "0.9.4",
|
|
42
47
|
"@kortyx/providers": "0.4.0",
|
|
43
|
-
"@kortyx/
|
|
44
|
-
"@kortyx/
|
|
48
|
+
"@kortyx/stream": "0.7.0",
|
|
49
|
+
"@kortyx/utils": "0.2.6"
|
|
45
50
|
},
|
|
46
51
|
"devDependencies": {
|
|
47
52
|
"turbo": "2.6.1",
|