@aigne/core 1.71.0-beta.1 → 1.71.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/lib/cjs/agents/agent.d.ts +6 -0
  3. package/lib/cjs/agents/agent.js +4 -1
  4. package/lib/cjs/aigne/aigne.d.ts +6 -1
  5. package/lib/cjs/aigne/aigne.js +13 -4
  6. package/lib/cjs/aigne/context.d.ts +2 -2
  7. package/lib/cjs/aigne/context.js +5 -22
  8. package/lib/cjs/loader/agent-js.d.ts +2 -1
  9. package/lib/cjs/loader/agent-js.js +2 -2
  10. package/lib/cjs/loader/agent-yaml.d.ts +4 -3
  11. package/lib/cjs/loader/agent-yaml.js +21 -17
  12. package/lib/cjs/loader/index.d.ts +3 -3
  13. package/lib/cjs/loader/index.js +1 -1
  14. package/lib/cjs/loader/schema.d.ts +1 -0
  15. package/lib/cjs/loader/schema.js +4 -0
  16. package/lib/cjs/prompt/filters/index.js +11 -9
  17. package/lib/cjs/prompt/prompt-builder.d.ts +4 -0
  18. package/lib/cjs/prompt/prompt-builder.js +55 -1
  19. package/lib/cjs/prompt/prompts/afs-builtin-prompt.d.ts +1 -0
  20. package/lib/cjs/prompt/prompts/afs-builtin-prompt.js +7 -4
  21. package/lib/cjs/prompt/skills/afs.js +7 -0
  22. package/lib/cjs/utils/event-stream.js +1 -0
  23. package/lib/dts/agents/agent.d.ts +6 -0
  24. package/lib/dts/aigne/aigne.d.ts +6 -1
  25. package/lib/dts/aigne/context.d.ts +2 -2
  26. package/lib/dts/loader/agent-js.d.ts +2 -1
  27. package/lib/dts/loader/agent-yaml.d.ts +4 -3
  28. package/lib/dts/loader/index.d.ts +3 -3
  29. package/lib/dts/loader/schema.d.ts +1 -0
  30. package/lib/dts/prompt/prompt-builder.d.ts +4 -0
  31. package/lib/dts/prompt/prompts/afs-builtin-prompt.d.ts +1 -0
  32. package/lib/esm/agents/agent.d.ts +6 -0
  33. package/lib/esm/agents/agent.js +4 -1
  34. package/lib/esm/aigne/aigne.d.ts +6 -1
  35. package/lib/esm/aigne/aigne.js +13 -4
  36. package/lib/esm/aigne/context.d.ts +2 -2
  37. package/lib/esm/aigne/context.js +5 -22
  38. package/lib/esm/loader/agent-js.d.ts +2 -1
  39. package/lib/esm/loader/agent-js.js +2 -2
  40. package/lib/esm/loader/agent-yaml.d.ts +4 -3
  41. package/lib/esm/loader/agent-yaml.js +22 -18
  42. package/lib/esm/loader/index.d.ts +3 -3
  43. package/lib/esm/loader/index.js +1 -1
  44. package/lib/esm/loader/schema.d.ts +1 -0
  45. package/lib/esm/loader/schema.js +3 -0
  46. package/lib/esm/prompt/filters/index.js +11 -9
  47. package/lib/esm/prompt/prompt-builder.d.ts +4 -0
  48. package/lib/esm/prompt/prompt-builder.js +57 -3
  49. package/lib/esm/prompt/prompts/afs-builtin-prompt.d.ts +1 -0
  50. package/lib/esm/prompt/prompts/afs-builtin-prompt.js +6 -3
  51. package/lib/esm/prompt/skills/afs.js +7 -0
  52. package/lib/esm/utils/event-stream.js +2 -1
  53. package/package.json +5 -5
@@ -4,9 +4,7 @@ export async function getAFSSystemPrompt(afs) {
4
4
  return `\
5
5
 
6
6
  <afs_usage>
7
- AFS (Agentic File System) provides tools to interact with a virtual file system,
8
- allowing you to list, search, read, and write files, or execute a useful tool from the available modules.
9
- Use these tools to manage and retrieve files as needed.
7
+ ${AFS_DESCRIPTION_PROMPT_TEMPLATE}
10
8
 
11
9
  Provided modules:
12
10
  ${stringify((await afs.listModules()).map((i) => pick(i, ["name", "path", "description"])))}
@@ -27,3 +25,8 @@ Here are the executable tools available in the AFS you can use:
27
25
  {{ tools | yaml.stringify }}
28
26
  </afs_executable_tools>
29
27
  `;
28
+ export const AFS_DESCRIPTION_PROMPT_TEMPLATE = `\
29
+ AFS (Agentic File System) provides tools to interact with a virtual file system,
30
+ allowing you to list, search, read, and write files, or execute a useful tool from the available modules.
31
+ You can use these tools to manage and retrieve files as needed.
32
+ `;
@@ -19,6 +19,7 @@ export async function getAFSSkills(afs) {
19
19
  return {
20
20
  status: "success",
21
21
  tool: "afs_list",
22
+ path: input.path,
22
23
  options: input.options,
23
24
  message,
24
25
  result,
@@ -36,6 +37,10 @@ export async function getAFSSkills(afs) {
36
37
  options: z
37
38
  .object({
38
39
  limit: z.number().optional().describe("Maximum number of entries to return"),
40
+ caseSensitive: z
41
+ .boolean()
42
+ .optional()
43
+ .describe("Whether the search is case sensitive, default is false"),
39
44
  })
40
45
  .optional(),
41
46
  }),
@@ -44,6 +49,7 @@ export async function getAFSSkills(afs) {
44
49
  return {
45
50
  status: "success",
46
51
  tool: "afs_search",
52
+ path: input.path,
47
53
  query: input.query,
48
54
  options: input.options,
49
55
  ...result,
@@ -80,6 +86,7 @@ Usage:
80
86
  status: "success",
81
87
  tool: "afs_read",
82
88
  path: input.path,
89
+ withLineNumbers: input.withLineNumbers,
83
90
  ...result,
84
91
  result: {
85
92
  ...result.result,
@@ -1,7 +1,8 @@
1
1
  import { createParser } from "eventsource-parser";
2
- import { produce } from "immer";
2
+ import { produce, setAutoFreeze } from "immer";
3
3
  import { isAgentResponseDelta, isAgentResponseProgress, } from "../agents/agent.js";
4
4
  import { tryOrThrow } from "./type-utils.js";
5
+ setAutoFreeze(false);
5
6
  export class EventStreamParser extends TransformStream {
6
7
  constructor() {
7
8
  let parser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/core",
3
- "version": "1.71.0-beta.1",
3
+ "version": "1.71.0-beta.4",
4
4
  "description": "The functional core of agentic AI",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -92,10 +92,10 @@
92
92
  "zod": "^3.25.67",
93
93
  "zod-from-json-schema": "^0.0.5",
94
94
  "zod-to-json-schema": "^3.24.6",
95
- "@aigne/afs-history": "^1.1.3-beta",
96
- "@aigne/observability-api": "^0.11.12",
97
- "@aigne/platform-helpers": "^0.6.5",
98
- "@aigne/afs": "^1.3.0-beta"
95
+ "@aigne/afs": "^1.3.0-beta.2",
96
+ "@aigne/afs-history": "^1.1.3-beta.2",
97
+ "@aigne/platform-helpers": "^0.6.6-beta",
98
+ "@aigne/observability-api": "^0.11.13-beta.1"
99
99
  },
100
100
  "devDependencies": {
101
101
  "@types/bun": "^1.2.22",