@kortyx/agent 0.4.0 → 0.4.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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.1](https://github.com/kortyx-io/kortyx/compare/agent-v0.4.0...agent-v0.4.1) (2026-02-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* remove kortyx.config support and update docs ([ecb3f8d](https://github.com/kortyx-io/kortyx/commit/ecb3f8d53a017cc84bf8db3e125a6f711f5d4013))
|
|
9
|
+
* remove kortyx.config support and update docs ([aa4a70a](https://github.com/kortyx-io/kortyx/commit/aa4a70a034dfec7bca829793f1729c51be018ae2))
|
|
10
|
+
|
|
3
11
|
## [0.4.0](https://github.com/kortyx-io/Kortyx/compare/agent-v0.3.0...agent-v0.4.0) (2026-02-07)
|
|
4
12
|
|
|
5
13
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WorkflowRegistry } from "@kortyx/runtime";
|
|
2
2
|
import type { SelectWorkflowFn } from "../orchestrator";
|
|
3
3
|
import type { ChatMessage } from "../types/chat-message";
|
|
4
4
|
import type { ProcessChatArgs } from "./process-chat";
|
|
@@ -7,8 +7,6 @@ export interface CreateAgentArgs<Config extends Record<string, unknown>, Options
|
|
|
7
7
|
workflowRegistry?: WorkflowRegistry;
|
|
8
8
|
selectWorkflow?: SelectWorkflowFn;
|
|
9
9
|
fallbackWorkflowId?: string;
|
|
10
|
-
config?: KortyxConfig;
|
|
11
|
-
configPath?: string;
|
|
12
10
|
}
|
|
13
11
|
export declare function createAgent<Config extends Record<string, unknown>, Options = unknown>(args: CreateAgentArgs<Config, Options>): {
|
|
14
12
|
processChat: (messages: ChatMessage[], options?: Options) => Promise<Response>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-agent.d.ts","sourceRoot":"","sources":["../../src/chat/create-agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"create-agent.d.ts","sourceRoot":"","sources":["../../src/chat/create-agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAK1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,MAAM,WAAW,eAAe,CAC9B,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,OAAO,CACP,SAAQ,IAAI,CACV,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,UAAU,GAAG,SAAS,GAAG,gBAAgB,GAAG,kBAAkB,CAC/D;IACD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,WAAW,CACzB,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,OAAO,GAAG,OAAO,EACjB,IAAI,EAAE,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC;4BAkCN,WAAW,EAAE,YAAY,OAAO;EAiCjE"}
|
|
@@ -5,8 +5,8 @@ const node_path_1 = require("node:path");
|
|
|
5
5
|
const runtime_1 = require("@kortyx/runtime");
|
|
6
6
|
const process_chat_1 = require("./process-chat");
|
|
7
7
|
function createAgent(args) {
|
|
8
|
-
const { workflowsDir, workflowRegistry, selectWorkflow, fallbackWorkflowId,
|
|
9
|
-
const resolvedDefaultWorkflowId = defaultWorkflowId ??
|
|
8
|
+
const { workflowsDir, workflowRegistry, selectWorkflow, fallbackWorkflowId, defaultWorkflowId, frameworkAdapter, ...baseArgs } = args;
|
|
9
|
+
const resolvedDefaultWorkflowId = defaultWorkflowId ?? fallbackWorkflowId;
|
|
10
10
|
const resolvedFrameworkAdapter = frameworkAdapter ?? (0, runtime_1.createFrameworkAdapterFromEnv)();
|
|
11
11
|
const resolvedCwd = process.cwd();
|
|
12
12
|
const registryPromise = (async () => {
|
|
@@ -18,23 +18,10 @@ function createAgent(args) {
|
|
|
18
18
|
fallbackId: fallbackWorkflowId ?? "general-chat",
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
cwd: resolvedCwd,
|
|
23
|
-
...(configPath ? { configPath } : {}),
|
|
24
|
-
};
|
|
25
|
-
const loadedConfig = config ?? (await (0, runtime_1.loadKortyxConfig)(loadConfigArgs));
|
|
26
|
-
const resolvedWorkflowsDir = loadedConfig?.workflowsDir ?? (0, node_path_1.resolve)(resolvedCwd, "src", "workflows");
|
|
21
|
+
const resolvedWorkflowsDir = (0, node_path_1.resolve)(resolvedCwd, "src", "workflows");
|
|
27
22
|
const registryOptions = {
|
|
28
23
|
workflowsDir: resolvedWorkflowsDir,
|
|
29
|
-
fallbackId:
|
|
30
|
-
fallbackWorkflowId ??
|
|
31
|
-
"general-chat",
|
|
32
|
-
...(loadedConfig?.registry?.cache !== undefined
|
|
33
|
-
? { cache: loadedConfig.registry.cache }
|
|
34
|
-
: {}),
|
|
35
|
-
...(loadedConfig?.registry?.extensions
|
|
36
|
-
? { extensions: loadedConfig.registry.extensions }
|
|
37
|
-
: {}),
|
|
24
|
+
fallbackId: fallbackWorkflowId ?? "general-chat",
|
|
38
25
|
};
|
|
39
26
|
return (0, runtime_1.createFileWorkflowRegistry)(registryOptions);
|
|
40
27
|
})();
|