@blocklet/pages-kit-agents 0.6.18 → 0.6.20

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.
@@ -1,6 +1,6 @@
1
- import { FSMemory, FSMemoryOptions } from '@aigne/agent-library/fs-memory/index.js';
2
1
  import { AnthropicChatModel } from '@aigne/anthropic';
3
2
  import { DeepSeekChatModel } from '@aigne/deepseek';
3
+ import { FSMemory, FSMemoryOptions } from '@aigne/fs-memory';
4
4
  import { GeminiChatModel } from '@aigne/gemini';
5
5
  import { OpenAIChatModel } from '@aigne/openai';
6
6
  import { XAIChatModel } from '@aigne/xai';
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getModel = getModel;
7
7
  exports.getMemory = getMemory;
8
- const index_js_1 = require("@aigne/agent-library/fs-memory/index.js");
9
8
  const anthropic_1 = require("@aigne/anthropic");
10
9
  const deepseek_1 = require("@aigne/deepseek");
10
+ const fs_memory_1 = require("@aigne/fs-memory");
11
11
  const gemini_1 = require("@aigne/gemini");
12
12
  const openai_1 = require("@aigne/openai");
13
13
  const xai_1 = require("@aigne/xai");
@@ -158,7 +158,7 @@ function getModel(modelName = 'openai') {
158
158
  function getMemory({ projectId = 'debug', ...rest }) {
159
159
  // === FSMemory 配置 ===
160
160
  const memoryRootDir = node_path_1.default.join(process.cwd(), 'project-records', projectId, 'memory');
161
- const fsMemory = new index_js_1.FSMemory({
161
+ const fsMemory = new fs_memory_1.FSMemory({
162
162
  ...(rest || {}),
163
163
  rootDir: memoryRootDir,
164
164
  recorderOptions: { instructions: recorderInstructions },
@@ -60,7 +60,7 @@ export default async function generatePageContentMultiAgent(input) {
60
60
  sectionName,
61
61
  sectionContentPlan,
62
62
  })),
63
- outputSchema: JSON.stringify(outputSchemaJson),
63
+ outputSchemaText: JSON.stringify(outputSchemaJson),
64
64
  expectedSections: JSON.stringify(sectionNames),
65
65
  });
66
66
  const { structurePlan } = structurePlanResult;
@@ -5,19 +5,19 @@ export declare const plannerParamsSchema: z.ZodObject<{
5
5
  context: z.ZodString;
6
6
  question: z.ZodString;
7
7
  locale: z.ZodString;
8
- outputSchema: z.ZodString;
8
+ outputSchemaText: z.ZodString;
9
9
  expectedSections: z.ZodString;
10
10
  }, "strip", z.ZodTypeAny, {
11
- outputSchema: string;
12
11
  context: string;
13
12
  question: string;
14
13
  locale: string;
14
+ outputSchemaText: string;
15
15
  expectedSections: string;
16
16
  }, {
17
- outputSchema: string;
18
17
  context: string;
19
18
  question: string;
20
19
  locale: string;
20
+ outputSchemaText: string;
21
21
  expectedSections: string;
22
22
  }>;
23
23
  export interface PageStructurePlannerOutput {
@@ -26,44 +26,12 @@ export interface PageStructurePlannerOutput {
26
26
  sectionContentPlan: string;
27
27
  }>;
28
28
  }
29
- export declare const pageStructurePlannerWithReflection: ReflectionAgent<{
30
- outputSchema: string;
31
- context: string;
32
- question: string;
33
- locale: string;
34
- expectedSections: string;
35
- validationFeedback?: {
36
- isValid: boolean;
37
- missingSections: string[];
38
- duplicateContent: {
39
- description: string;
40
- sections: string[];
41
- score: number;
42
- suggestion: string;
43
- }[];
44
- } | undefined;
45
- structurePlan?: {
46
- sectionName: string;
47
- sectionContentPlan: string;
48
- }[] | undefined;
49
- }, {
50
- isApproved: boolean;
51
- validationFeedback: {
52
- isValid: boolean;
53
- missingSections: string[];
54
- duplicateContent: {
55
- description: string;
56
- sections: string[];
57
- score: number;
58
- suggestion: string;
59
- }[];
60
- };
61
- }>;
29
+ export declare const pageStructurePlannerWithReflection: ReflectionAgent<import("@aigne/core").Message, import("@aigne/core").Message>;
62
30
  export declare const pageStructurePlannerAgent: AIAgent<{
63
- outputSchema: string;
64
31
  context: string;
65
32
  question: string;
66
33
  locale: string;
34
+ outputSchemaText: string;
67
35
  expectedSections: string;
68
36
  validationFeedback?: {
69
37
  isValid: boolean;
@@ -80,10 +48,10 @@ export declare const pageStructurePlannerAgent: AIAgent<{
80
48
  sectionContentPlan: string;
81
49
  }[] | undefined;
82
50
  }, {
83
- outputSchema: string;
84
51
  context: string;
85
52
  question: string;
86
53
  locale: string;
54
+ outputSchemaText: string;
87
55
  expectedSections: string;
88
56
  structurePlan: {
89
57
  sectionName: string;
@@ -9,7 +9,7 @@ export const plannerParamsSchema = z.object({
9
9
  context: z.string(),
10
10
  question: z.string(),
11
11
  locale: z.string(),
12
- outputSchema: z.string(),
12
+ outputSchemaText: z.string(),
13
13
  expectedSections: z.string(),
14
14
  });
15
15
  const validationFeedbackSchema = z.object({
@@ -38,7 +38,7 @@ const contextRule = `
38
38
 
39
39
  输出结构模式:
40
40
  <output-schema>
41
- {{outputSchema}}
41
+ {{outputSchemaText}}
42
42
  </output-schema>
43
43
 
44
44
  预期包含的Sections:
@@ -19,6 +19,6 @@ export declare const routerDataCacheGeneratorAgent: FunctionAgent<{
19
19
  locale?: string | undefined;
20
20
  }, {
21
21
  success: boolean;
22
- dataCache?: any;
23
22
  error?: string | undefined;
23
+ dataCache?: any;
24
24
  }>;
@@ -1,4 +1,4 @@
1
- // import { DefaultMemory } from '@aigne/agent-library/default-memory/index.js';
1
+ // import { DefaultMemory } from '@aigne/default-memory';
2
2
  import { AIAgent } from '@aigne/core';
3
3
  // import assert from 'node:assert';
4
4
  import { z } from 'zod';
@@ -39,28 +39,9 @@ export declare const generatorParamsSchema: z.ZodObject<{
39
39
  component: string;
40
40
  }[];
41
41
  }>;
42
- export declare const generatorAgentWithReflection: ReflectionAgent<{
43
- ascii: string;
44
- collectResult: string;
45
- filteredComponentList: {
46
- name: string;
47
- description: string;
48
- id: string;
49
- component: string;
50
- }[];
51
- }, {
52
- isApproved: boolean;
53
- feedback: {
54
- description: string;
55
- line: number;
56
- column: number;
57
- keyword: string;
58
- rule: string;
59
- isRequired: boolean;
60
- }[];
61
- }>;
42
+ export declare const generatorAgentWithReflection: ReflectionAgent<import("@aigne/core").Message, import("@aigne/core").Message>;
62
43
  export declare const saveTemplateYamlAgent: FunctionAgent<{
63
44
  templateYaml: string;
64
45
  }, {
65
46
  $message: string;
66
- } & import("@aigne/core").Message>;
47
+ }>;
@@ -1,5 +1,5 @@
1
- // import { DefaultMemory } from '@aigne/agent-library/default-memory/index.js';
2
- import { AIAgent, FunctionAgent, createMessage } from '@aigne/core';
1
+ // import { DefaultMemory } from '@aigne/default-memory';
2
+ import { AIAgent, FunctionAgent } from '@aigne/core';
3
3
  // import assert from 'node:assert';
4
4
  import fs from 'node:fs';
5
5
  import path from 'node:path';
@@ -185,6 +185,8 @@ export const saveTemplateYamlAgent = FunctionAgent.from({
185
185
  const filePath = path.join(__dirname, `../test-templates/template-${templateName}.yaml`);
186
186
  // 把 yaml 结构保存到文件
187
187
  fs.writeFileSync(filePath, templateYaml);
188
- return createMessage(`Yaml 结构已保存到 ${filePath}`);
188
+ return {
189
+ $message: `Yaml 结构已保存到 ${filePath}`,
190
+ };
189
191
  },
190
192
  });