@aigne/core 1.72.0-beta.3 → 1.72.0-beta.4
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 +20 -0
- package/lib/cjs/agents/agent.d.ts +31 -1
- package/lib/cjs/agents/agent.js +13 -0
- package/lib/cjs/agents/ai-agent.d.ts +7 -0
- package/lib/cjs/agents/ai-agent.js +85 -3
- package/lib/cjs/agents/image-agent.d.ts +17 -1
- package/lib/cjs/agents/image-agent.js +16 -0
- package/lib/cjs/agents/image-model.d.ts +4 -4
- package/lib/cjs/agents/mcp-agent.d.ts +17 -0
- package/lib/cjs/agents/mcp-agent.js +18 -0
- package/lib/cjs/agents/team-agent.d.ts +55 -0
- package/lib/cjs/agents/team-agent.js +31 -0
- package/lib/cjs/agents/transform-agent.d.ts +12 -0
- package/lib/cjs/agents/transform-agent.js +13 -0
- package/lib/cjs/agents/video-model.d.ts +4 -4
- package/lib/cjs/loader/agent-yaml.d.ts +5 -67
- package/lib/cjs/loader/agent-yaml.js +4 -139
- package/lib/cjs/loader/agents.d.ts +4 -0
- package/lib/cjs/loader/agents.js +17 -0
- package/lib/cjs/loader/index.d.ts +18 -14
- package/lib/cjs/loader/index.js +20 -81
- package/lib/cjs/loader/schema.d.ts +21 -6
- package/lib/cjs/loader/schema.js +60 -1
- package/lib/cjs/prompt/prompt-builder.js +0 -1
- package/lib/cjs/prompt/skills/afs/agent-skill/agent-skill.d.ts +17 -0
- package/lib/cjs/prompt/skills/afs/agent-skill/agent-skill.js +63 -0
- package/lib/cjs/prompt/skills/afs/agent-skill/skill-loader.d.ts +13 -0
- package/lib/cjs/prompt/skills/afs/agent-skill/skill-loader.js +61 -0
- package/lib/cjs/prompt/skills/afs/delete.js +15 -3
- package/lib/cjs/prompt/skills/afs/edit.js +30 -7
- package/lib/cjs/prompt/skills/afs/exec.js +17 -6
- package/lib/cjs/prompt/skills/afs/index.js +4 -1
- package/lib/cjs/prompt/skills/afs/list.js +26 -10
- package/lib/cjs/prompt/skills/afs/read.js +14 -3
- package/lib/cjs/prompt/skills/afs/rename.js +18 -4
- package/lib/cjs/prompt/skills/afs/search.js +21 -5
- package/lib/cjs/prompt/skills/afs/write.js +18 -4
- package/lib/cjs/prompt/template.d.ts +23 -23
- package/lib/dts/agents/agent.d.ts +31 -1
- package/lib/dts/agents/ai-agent.d.ts +7 -0
- package/lib/dts/agents/image-agent.d.ts +17 -1
- package/lib/dts/agents/image-model.d.ts +4 -4
- package/lib/dts/agents/mcp-agent.d.ts +17 -0
- package/lib/dts/agents/team-agent.d.ts +55 -0
- package/lib/dts/agents/transform-agent.d.ts +12 -0
- package/lib/dts/agents/video-model.d.ts +4 -4
- package/lib/dts/aigne/context.d.ts +2 -2
- package/lib/dts/loader/agent-yaml.d.ts +5 -67
- package/lib/dts/loader/agents.d.ts +4 -0
- package/lib/dts/loader/index.d.ts +18 -14
- package/lib/dts/loader/schema.d.ts +21 -6
- package/lib/dts/prompt/skills/afs/agent-skill/agent-skill.d.ts +17 -0
- package/lib/dts/prompt/skills/afs/agent-skill/skill-loader.d.ts +13 -0
- package/lib/dts/prompt/template.d.ts +25 -25
- package/lib/esm/agents/agent.d.ts +31 -1
- package/lib/esm/agents/agent.js +13 -0
- package/lib/esm/agents/ai-agent.d.ts +7 -0
- package/lib/esm/agents/ai-agent.js +85 -3
- package/lib/esm/agents/image-agent.d.ts +17 -1
- package/lib/esm/agents/image-agent.js +16 -0
- package/lib/esm/agents/image-model.d.ts +4 -4
- package/lib/esm/agents/mcp-agent.d.ts +17 -0
- package/lib/esm/agents/mcp-agent.js +18 -0
- package/lib/esm/agents/team-agent.d.ts +55 -0
- package/lib/esm/agents/team-agent.js +31 -0
- package/lib/esm/agents/transform-agent.d.ts +12 -0
- package/lib/esm/agents/transform-agent.js +13 -0
- package/lib/esm/agents/video-model.d.ts +4 -4
- package/lib/esm/aigne/context.d.ts +2 -2
- package/lib/esm/loader/agent-yaml.d.ts +5 -67
- package/lib/esm/loader/agent-yaml.js +4 -138
- package/lib/esm/loader/agents.d.ts +4 -0
- package/lib/esm/loader/agents.js +14 -0
- package/lib/esm/loader/index.d.ts +18 -14
- package/lib/esm/loader/index.js +21 -81
- package/lib/esm/loader/schema.d.ts +21 -6
- package/lib/esm/loader/schema.js +57 -0
- package/lib/esm/prompt/prompt-builder.js +1 -2
- package/lib/esm/prompt/skills/afs/agent-skill/agent-skill.d.ts +17 -0
- package/lib/esm/prompt/skills/afs/agent-skill/agent-skill.js +59 -0
- package/lib/esm/prompt/skills/afs/agent-skill/skill-loader.d.ts +13 -0
- package/lib/esm/prompt/skills/afs/agent-skill/skill-loader.js +53 -0
- package/lib/esm/prompt/skills/afs/delete.js +15 -3
- package/lib/esm/prompt/skills/afs/edit.js +30 -7
- package/lib/esm/prompt/skills/afs/exec.js +17 -6
- package/lib/esm/prompt/skills/afs/index.js +4 -1
- package/lib/esm/prompt/skills/afs/list.js +26 -10
- package/lib/esm/prompt/skills/afs/read.js +14 -3
- package/lib/esm/prompt/skills/afs/rename.js +18 -4
- package/lib/esm/prompt/skills/afs/search.js +21 -5
- package/lib/esm/prompt/skills/afs/write.js +18 -4
- package/lib/esm/prompt/template.d.ts +25 -25
- package/package.json +5 -4
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isNonNullable } from "../../../utils/type-utils.js";
|
|
2
|
+
import { loadAgentSkillFromAFS } from "./agent-skill/skill-loader.js";
|
|
1
3
|
import { AFSDeleteAgent } from "./delete.js";
|
|
2
4
|
import { AFSEditAgent } from "./edit.js";
|
|
3
5
|
import { AFSExecAgent } from "./exec.js";
|
|
@@ -16,5 +18,6 @@ export async function getAFSSkills(afs) {
|
|
|
16
18
|
new AFSDeleteAgent({ afs }),
|
|
17
19
|
new AFSRenameAgent({ afs }),
|
|
18
20
|
new AFSExecAgent({ afs }),
|
|
19
|
-
|
|
21
|
+
await loadAgentSkillFromAFS({ afs }),
|
|
22
|
+
].filter(isNonNullable);
|
|
20
23
|
}
|
|
@@ -4,26 +4,42 @@ export class AFSListAgent extends AFSSkillBase {
|
|
|
4
4
|
constructor(options) {
|
|
5
5
|
super({
|
|
6
6
|
name: "afs_list",
|
|
7
|
-
description:
|
|
7
|
+
description: `List contents within the Agentic File System (AFS)
|
|
8
|
+
- Returns files and directories at the specified AFS path
|
|
9
|
+
- Supports recursive listing with configurable depth
|
|
10
|
+
- Supports glob pattern filtering to match specific files
|
|
11
|
+
- By default respects .gitignore rules to filter out ignored files
|
|
12
|
+
- Use this tool when you need to explore AFS contents or understand file organization
|
|
13
|
+
|
|
14
|
+
Usage:
|
|
15
|
+
- The path must be an absolute AFS path starting with "/" (e.g., "/", "/docs", "/memory/user")
|
|
16
|
+
- This is NOT a local system file path - it operates within the AFS virtual file system
|
|
17
|
+
- Use maxDepth to control recursion depth (default: 1, current directory only)
|
|
18
|
+
- Use pattern to filter entries by glob pattern:
|
|
19
|
+
- "*.ts" - match TypeScript files in current directory
|
|
20
|
+
- "**/*.js" - match all JavaScript files recursively
|
|
21
|
+
- "src/**/*.{ts,tsx}" - match TypeScript files in src directory
|
|
22
|
+
- Results are filtered by .gitignore by default; set disableGitignore to include ignored files`,
|
|
8
23
|
...options,
|
|
9
24
|
inputSchema: z.object({
|
|
10
|
-
path: z
|
|
25
|
+
path: z
|
|
26
|
+
.string()
|
|
27
|
+
.describe("Absolute AFS path to list (e.g., '/', '/docs', '/memory/user'). Must start with '/'"),
|
|
11
28
|
options: z
|
|
12
29
|
.object({
|
|
13
|
-
maxDepth: z
|
|
30
|
+
maxDepth: z
|
|
31
|
+
.number()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Maximum depth of directory recursion. 1 = current directory only, 2 = include subdirectories, etc. Default: 1"),
|
|
14
34
|
disableGitignore: z
|
|
15
35
|
.boolean()
|
|
16
36
|
.optional()
|
|
17
|
-
.describe("
|
|
37
|
+
.describe("Set to true to include files normally ignored by .gitignore rules. Default: false (respects .gitignore)"),
|
|
18
38
|
maxChildren: z
|
|
19
39
|
.number()
|
|
20
40
|
.optional()
|
|
21
|
-
.describe("Maximum number of
|
|
22
|
-
|
|
23
|
-
.union([z.literal("simple-list"), z.literal("tree")])
|
|
24
|
-
.optional()
|
|
25
|
-
.default("simple-list")
|
|
26
|
-
.describe("Output format, either 'simple-list', or 'tree', default is 'simple-list'"),
|
|
41
|
+
.describe("Maximum number of entries to return per directory. Useful for large directories to avoid overwhelming output"),
|
|
42
|
+
pattern: z.string().optional().describe("Glob pattern to filter entries by path"),
|
|
27
43
|
})
|
|
28
44
|
.optional(),
|
|
29
45
|
}),
|
|
@@ -4,14 +4,25 @@ export class AFSReadAgent extends AFSSkillBase {
|
|
|
4
4
|
constructor(options) {
|
|
5
5
|
super({
|
|
6
6
|
name: "afs_read",
|
|
7
|
-
description:
|
|
7
|
+
description: `Read file contents from the Agentic File System (AFS)
|
|
8
|
+
- Returns the complete content of a file at the specified AFS path
|
|
9
|
+
- Supports line numbers output for precise editing references
|
|
10
|
+
- Use this tool when you need to review, analyze, or understand file content
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
- The path must be an absolute AFS path starting with "/" (e.g., "/docs/readme.md", "/memory/user/notes")
|
|
14
|
+
- This is NOT a local system file path - it operates within the AFS virtual file system
|
|
15
|
+
- IMPORTANT: You MUST set withLineNumbers to true before using afs_edit, as line numbers are required for precise edits
|
|
16
|
+
- Returns the file's content along with metadata (id, path, timestamps, etc.)`,
|
|
8
17
|
...options,
|
|
9
18
|
inputSchema: z.object({
|
|
10
|
-
path: z
|
|
19
|
+
path: z
|
|
20
|
+
.string()
|
|
21
|
+
.describe("Absolute AFS path to the file to read (e.g., '/docs/readme.md'). Must start with '/'"),
|
|
11
22
|
withLineNumbers: z
|
|
12
23
|
.boolean()
|
|
13
24
|
.optional()
|
|
14
|
-
.describe("
|
|
25
|
+
.describe("MUST be set to true before using afs_edit. Adds line numbers to output (format: '1| line content')"),
|
|
15
26
|
}),
|
|
16
27
|
outputSchema: z.object({
|
|
17
28
|
status: z.string(),
|
|
@@ -4,16 +4,30 @@ export class AFSRenameAgent extends AFSSkillBase {
|
|
|
4
4
|
constructor(options) {
|
|
5
5
|
super({
|
|
6
6
|
name: "afs_rename",
|
|
7
|
-
description:
|
|
7
|
+
description: `Rename or move files and directories within the Agentic File System (AFS)
|
|
8
|
+
- Renames a file or directory to a new name
|
|
9
|
+
- Can also move files/directories to a different location
|
|
10
|
+
- Optionally overwrites existing files at the destination
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
- Both paths must be absolute AFS paths starting with "/" (e.g., "/docs/old-name.md" -> "/docs/new-name.md")
|
|
14
|
+
- This is NOT a local system file path - it operates within the AFS virtual file system
|
|
15
|
+
- To move a file, specify a different directory in newPath (e.g., "/docs/file.md" -> "/archive/file.md")
|
|
16
|
+
- If newPath already exists, the operation will fail unless overwrite=true
|
|
17
|
+
- Moving directories moves all contents recursively`,
|
|
8
18
|
...options,
|
|
9
19
|
inputSchema: z.object({
|
|
10
|
-
oldPath: z
|
|
11
|
-
|
|
20
|
+
oldPath: z
|
|
21
|
+
.string()
|
|
22
|
+
.describe("Current absolute AFS path (e.g., '/docs/old-name.md'). Must start with '/'"),
|
|
23
|
+
newPath: z
|
|
24
|
+
.string()
|
|
25
|
+
.describe("New absolute AFS path (e.g., '/docs/new-name.md'). Must start with '/'"),
|
|
12
26
|
overwrite: z
|
|
13
27
|
.boolean()
|
|
14
28
|
.optional()
|
|
15
29
|
.default(false)
|
|
16
|
-
.describe("
|
|
30
|
+
.describe("Set to true to overwrite if destination already exists. Default: false (fails if exists)"),
|
|
17
31
|
}),
|
|
18
32
|
outputSchema: z.object({
|
|
19
33
|
status: z.string(),
|
|
@@ -4,18 +4,34 @@ export class AFSSearchAgent extends AFSSkillBase {
|
|
|
4
4
|
constructor(options) {
|
|
5
5
|
super({
|
|
6
6
|
name: "afs_search",
|
|
7
|
-
description:
|
|
7
|
+
description: `Search file contents within the Agentic File System (AFS)
|
|
8
|
+
- Searches for files containing specific text, keywords, or patterns
|
|
9
|
+
- Returns matching entries with their content and metadata
|
|
10
|
+
- Supports case-sensitive and case-insensitive search modes
|
|
11
|
+
- Use this tool when you need to find files by their content
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
- The path must be an absolute AFS path starting with "/" (e.g., "/", "/docs", "/memory")
|
|
15
|
+
- This is NOT a local system file path - it operates within the AFS virtual file system
|
|
16
|
+
- The query can be keywords, phrases, or text patterns to search for
|
|
17
|
+
- Use limit to control the number of results returned
|
|
18
|
+
- Search is case-insensitive by default; set caseSensitive to true for exact case matching`,
|
|
8
19
|
...options,
|
|
9
20
|
inputSchema: z.object({
|
|
10
|
-
path: z
|
|
11
|
-
|
|
21
|
+
path: z
|
|
22
|
+
.string()
|
|
23
|
+
.describe("Absolute AFS path to search in (e.g., '/', '/docs', '/memory'). Must start with '/'"),
|
|
24
|
+
query: z.string().describe("Text, keywords, or patterns to search for in file contents"),
|
|
12
25
|
options: z
|
|
13
26
|
.object({
|
|
14
|
-
limit: z
|
|
27
|
+
limit: z
|
|
28
|
+
.number()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("Maximum number of results to return. Useful for limiting output size"),
|
|
15
31
|
caseSensitive: z
|
|
16
32
|
.boolean()
|
|
17
33
|
.optional()
|
|
18
|
-
.describe("
|
|
34
|
+
.describe("Set to true for case-sensitive matching. Default: false (case-insensitive)"),
|
|
19
35
|
})
|
|
20
36
|
.optional(),
|
|
21
37
|
}),
|
|
@@ -4,16 +4,30 @@ export class AFSWriteAgent extends AFSSkillBase {
|
|
|
4
4
|
constructor(options) {
|
|
5
5
|
super({
|
|
6
6
|
name: "afs_write",
|
|
7
|
-
description:
|
|
7
|
+
description: `Write or create files in the Agentic File System (AFS)
|
|
8
|
+
- Creates a new file or overwrites an existing file with the provided content
|
|
9
|
+
- Supports append mode to add content to the end of existing files
|
|
10
|
+
- Use this tool when creating new files or completely replacing file contents
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
- The path must be an absolute AFS path starting with "/" (e.g., "/docs/new-file.md", "/memory/user/notes")
|
|
14
|
+
- This is NOT a local system file path - it operates within the AFS virtual file system
|
|
15
|
+
- By default, this tool overwrites the entire file content
|
|
16
|
+
- Use append mode to add content to the end of an existing file without replacing it
|
|
17
|
+
- For partial edits to existing files, prefer using afs_edit instead`,
|
|
8
18
|
...options,
|
|
9
19
|
inputSchema: z.object({
|
|
10
|
-
path: z
|
|
11
|
-
|
|
20
|
+
path: z
|
|
21
|
+
.string()
|
|
22
|
+
.describe("Absolute AFS path for the file to write (e.g., '/docs/new-file.md'). Must start with '/'"),
|
|
23
|
+
content: z
|
|
24
|
+
.string()
|
|
25
|
+
.describe("The content to write to the file. In overwrite mode, this replaces the entire file"),
|
|
12
26
|
append: z
|
|
13
27
|
.boolean()
|
|
14
28
|
.optional()
|
|
15
29
|
.default(false)
|
|
16
|
-
.describe("
|
|
30
|
+
.describe("Set to true to append content to the end of an existing file. Default: false (overwrites entire file)"),
|
|
17
31
|
}),
|
|
18
32
|
outputSchema: z.object({
|
|
19
33
|
status: z.string(),
|
|
@@ -42,11 +42,11 @@ export declare class AgentMessageTemplate extends ChatMessageTemplate {
|
|
|
42
42
|
static from(template?: ChatModelInputMessage["content"], toolCalls?: ChatModelOutputToolCall[], name?: string, options?: FormatOptions, cacheControl?: ChatModelInputMessage["cacheControl"]): AgentMessageTemplate;
|
|
43
43
|
constructor(content?: ChatModelInputMessage["content"], toolCalls?: ChatModelOutputToolCall[] | undefined, name?: string, options?: FormatOptions, cacheControl?: ChatModelInputMessage["cacheControl"]);
|
|
44
44
|
format(_variables?: Record<string, unknown>, _options?: FormatOptions): Promise<{
|
|
45
|
-
role: "
|
|
45
|
+
role: "system" | "user" | "agent" | "tool";
|
|
46
46
|
name: string | undefined;
|
|
47
47
|
content: ChatModelInputMessageContent | undefined;
|
|
48
48
|
toolCalls: ChatModelOutputToolCall[] | undefined;
|
|
49
|
-
cacheControl: import("../
|
|
49
|
+
cacheControl: import("../index.js").CacheControl | undefined;
|
|
50
50
|
}>;
|
|
51
51
|
}
|
|
52
52
|
export declare class ToolMessageTemplate extends ChatMessageTemplate {
|
|
@@ -54,11 +54,11 @@ export declare class ToolMessageTemplate extends ChatMessageTemplate {
|
|
|
54
54
|
static from(content: object | string, toolCallId: string, name?: string, options?: FormatOptions, cacheControl?: ChatModelInputMessage["cacheControl"]): ToolMessageTemplate;
|
|
55
55
|
constructor(content: object | string, toolCallId: string, name?: string, options?: FormatOptions, cacheControl?: ChatModelInputMessage["cacheControl"]);
|
|
56
56
|
format(_variables?: Record<string, unknown>, _options?: FormatOptions): Promise<{
|
|
57
|
-
role: "
|
|
57
|
+
role: "system" | "user" | "agent" | "tool";
|
|
58
58
|
name: string | undefined;
|
|
59
59
|
content: ChatModelInputMessageContent | undefined;
|
|
60
60
|
toolCallId: string;
|
|
61
|
-
cacheControl: import("../
|
|
61
|
+
cacheControl: import("../index.js").CacheControl | undefined;
|
|
62
62
|
}>;
|
|
63
63
|
}
|
|
64
64
|
export declare class ChatMessagesTemplate {
|
|
@@ -83,21 +83,21 @@ declare const chatMessageSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
83
83
|
ttl?: "5m" | "1h" | undefined;
|
|
84
84
|
}>>;
|
|
85
85
|
}, "strip", z.ZodTypeAny, {
|
|
86
|
-
role: "system";
|
|
87
86
|
content: string;
|
|
88
|
-
|
|
87
|
+
role: "system";
|
|
89
88
|
cacheControl?: {
|
|
90
89
|
type: "ephemeral";
|
|
91
90
|
ttl?: "5m" | "1h" | undefined;
|
|
92
91
|
} | undefined;
|
|
92
|
+
name?: string | undefined;
|
|
93
93
|
}, {
|
|
94
|
-
role: "system";
|
|
95
94
|
content: string;
|
|
96
|
-
|
|
95
|
+
role: "system";
|
|
97
96
|
cacheControl?: {
|
|
98
97
|
type: "ephemeral";
|
|
99
98
|
ttl?: "5m" | "1h" | undefined;
|
|
100
99
|
} | undefined;
|
|
100
|
+
name?: string | undefined;
|
|
101
101
|
}>, z.ZodObject<{
|
|
102
102
|
role: z.ZodLiteral<"user">;
|
|
103
103
|
content: z.ZodString;
|
|
@@ -113,21 +113,21 @@ declare const chatMessageSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
113
113
|
ttl?: "5m" | "1h" | undefined;
|
|
114
114
|
}>>;
|
|
115
115
|
}, "strip", z.ZodTypeAny, {
|
|
116
|
-
role: "user";
|
|
117
116
|
content: string;
|
|
118
|
-
|
|
117
|
+
role: "user";
|
|
119
118
|
cacheControl?: {
|
|
120
119
|
type: "ephemeral";
|
|
121
120
|
ttl?: "5m" | "1h" | undefined;
|
|
122
121
|
} | undefined;
|
|
122
|
+
name?: string | undefined;
|
|
123
123
|
}, {
|
|
124
|
-
role: "user";
|
|
125
124
|
content: string;
|
|
126
|
-
|
|
125
|
+
role: "user";
|
|
127
126
|
cacheControl?: {
|
|
128
127
|
type: "ephemeral";
|
|
129
128
|
ttl?: "5m" | "1h" | undefined;
|
|
130
129
|
} | undefined;
|
|
130
|
+
name?: string | undefined;
|
|
131
131
|
}>, z.ZodObject<{
|
|
132
132
|
role: z.ZodLiteral<"agent">;
|
|
133
133
|
content: z.ZodOptional<z.ZodString>;
|
|
@@ -172,8 +172,11 @@ declare const chatMessageSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
172
172
|
}>>;
|
|
173
173
|
}, "strip", z.ZodTypeAny, {
|
|
174
174
|
role: "agent";
|
|
175
|
-
name?: string | undefined;
|
|
176
175
|
content?: string | undefined;
|
|
176
|
+
cacheControl?: {
|
|
177
|
+
type: "ephemeral";
|
|
178
|
+
ttl?: "5m" | "1h" | undefined;
|
|
179
|
+
} | undefined;
|
|
177
180
|
toolCalls?: {
|
|
178
181
|
function: {
|
|
179
182
|
name: string;
|
|
@@ -182,14 +185,14 @@ declare const chatMessageSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
182
185
|
type: "function";
|
|
183
186
|
id: string;
|
|
184
187
|
}[] | undefined;
|
|
188
|
+
name?: string | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
role: "agent";
|
|
191
|
+
content?: string | undefined;
|
|
185
192
|
cacheControl?: {
|
|
186
193
|
type: "ephemeral";
|
|
187
194
|
ttl?: "5m" | "1h" | undefined;
|
|
188
195
|
} | undefined;
|
|
189
|
-
}, {
|
|
190
|
-
role: "agent";
|
|
191
|
-
name?: string | undefined;
|
|
192
|
-
content?: string | undefined;
|
|
193
196
|
toolCalls?: {
|
|
194
197
|
function: {
|
|
195
198
|
name: string;
|
|
@@ -198,10 +201,7 @@ declare const chatMessageSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
198
201
|
type: "function";
|
|
199
202
|
id: string;
|
|
200
203
|
}[] | undefined;
|
|
201
|
-
|
|
202
|
-
type: "ephemeral";
|
|
203
|
-
ttl?: "5m" | "1h" | undefined;
|
|
204
|
-
} | undefined;
|
|
204
|
+
name?: string | undefined;
|
|
205
205
|
}>, z.ZodObject<{
|
|
206
206
|
role: z.ZodLiteral<"tool">;
|
|
207
207
|
content: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, string, string | Record<string, unknown>>;
|
|
@@ -218,23 +218,23 @@ declare const chatMessageSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
218
218
|
ttl?: "5m" | "1h" | undefined;
|
|
219
219
|
}>>;
|
|
220
220
|
}, "strip", z.ZodTypeAny, {
|
|
221
|
-
role: "tool";
|
|
222
221
|
content: string;
|
|
222
|
+
role: "tool";
|
|
223
223
|
toolCallId: string;
|
|
224
|
-
name?: string | undefined;
|
|
225
224
|
cacheControl?: {
|
|
226
225
|
type: "ephemeral";
|
|
227
226
|
ttl?: "5m" | "1h" | undefined;
|
|
228
227
|
} | undefined;
|
|
228
|
+
name?: string | undefined;
|
|
229
229
|
}, {
|
|
230
|
-
role: "tool";
|
|
231
230
|
content: string | Record<string, unknown>;
|
|
231
|
+
role: "tool";
|
|
232
232
|
toolCallId: string;
|
|
233
|
-
name?: string | undefined;
|
|
234
233
|
cacheControl?: {
|
|
235
234
|
type: "ephemeral";
|
|
236
235
|
ttl?: "5m" | "1h" | undefined;
|
|
237
236
|
} | undefined;
|
|
237
|
+
name?: string | undefined;
|
|
238
238
|
}>]>;
|
|
239
239
|
export declare function safeParseChatMessages(messages: unknown): ChatMessageTemplate[] | undefined;
|
|
240
240
|
export declare function parseChatMessages(messages: (z.infer<typeof chatMessageSchema> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/core",
|
|
3
|
-
"version": "1.72.0-beta.
|
|
3
|
+
"version": "1.72.0-beta.4",
|
|
4
4
|
"description": "The functional core of agentic AI",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"debug": "^4.4.3",
|
|
79
79
|
"eventsource-parser": "^3.0.6",
|
|
80
80
|
"fast-deep-equal": "^3.1.3",
|
|
81
|
+
"front-matter": "^4.0.2",
|
|
81
82
|
"immer": "^10.1.3",
|
|
82
83
|
"is-network-error": "^1.2.0",
|
|
83
84
|
"jaison": "^2.0.2",
|
|
@@ -92,10 +93,10 @@
|
|
|
92
93
|
"zod": "^3.25.67",
|
|
93
94
|
"zod-from-json-schema": "^0.0.5",
|
|
94
95
|
"zod-to-json-schema": "^3.24.6",
|
|
95
|
-
"@aigne/afs": "^1.
|
|
96
|
-
"@aigne/platform-helpers": "^0.6.7-beta",
|
|
96
|
+
"@aigne/afs-history": "^1.2.0-beta.3",
|
|
97
97
|
"@aigne/observability-api": "^0.11.14-beta.1",
|
|
98
|
-
"@aigne/afs
|
|
98
|
+
"@aigne/afs": "^1.4.0-beta.3",
|
|
99
|
+
"@aigne/platform-helpers": "^0.6.7-beta"
|
|
99
100
|
},
|
|
100
101
|
"devDependencies": {
|
|
101
102
|
"@types/bun": "^1.2.22",
|