@autobe/agent 0.8.0 → 0.9.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.
Files changed (91) hide show
  1. package/lib/AutoBeAgent.d.ts +183 -12
  2. package/lib/AutoBeAgent.js +247 -65
  3. package/lib/AutoBeAgent.js.map +1 -1
  4. package/lib/constants/AutoBeSystemPromptConstant.d.ts +4 -3
  5. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  6. package/lib/context/AutoBeContext.d.ts +2 -2
  7. package/lib/factory/index.d.ts +0 -1
  8. package/lib/factory/index.js +0 -1
  9. package/lib/factory/index.js.map +1 -1
  10. package/lib/index.mjs +1195 -834
  11. package/lib/index.mjs.map +1 -1
  12. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +1 -1
  13. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
  14. package/lib/orchestrate/interface/orchestrateInterface.js +1 -1
  15. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  16. package/lib/orchestrate/prisma/orchestratePrisma.js +1 -1
  17. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  18. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1 -1
  19. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  20. package/lib/orchestrate/test/compileTestScenario.d.ts +5 -0
  21. package/lib/orchestrate/test/compileTestScenario.js +56 -0
  22. package/lib/orchestrate/test/compileTestScenario.js.map +1 -0
  23. package/lib/orchestrate/test/filterTestFileName.d.ts +1 -0
  24. package/lib/orchestrate/test/filterTestFileName.js +13 -0
  25. package/lib/orchestrate/test/filterTestFileName.js.map +1 -0
  26. package/lib/orchestrate/test/orchestrateTest.js +10 -11
  27. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  28. package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +2 -2
  29. package/lib/orchestrate/test/orchestrateTestCorrect.js +91 -73
  30. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  31. package/lib/orchestrate/test/orchestrateTestScenario.d.ts +2 -2
  32. package/lib/orchestrate/test/orchestrateTestScenario.js +616 -237
  33. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  34. package/lib/orchestrate/test/orchestrateTestWrite.d.ts +4 -0
  35. package/lib/orchestrate/test/{orchestrateTestProgress.js → orchestrateTestWrite.js} +37 -51
  36. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -0
  37. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +123 -0
  38. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js +3 -0
  39. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js.map +1 -0
  40. package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +5 -0
  41. package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.js +3 -0
  42. package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.js.map +1 -0
  43. package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +2 -1
  44. package/lib/orchestrate/test/transformTestCorrectHistories.js +4 -4
  45. package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -1
  46. package/lib/orchestrate/test/transformTestScenarioHistories.d.ts +1 -2
  47. package/lib/orchestrate/test/transformTestScenarioHistories.js +1 -77
  48. package/lib/orchestrate/test/transformTestScenarioHistories.js.map +1 -1
  49. package/lib/orchestrate/test/transformTestWriteHistories.d.ts +7 -0
  50. package/lib/orchestrate/test/transformTestWriteHistories.js +47 -0
  51. package/lib/orchestrate/test/transformTestWriteHistories.js.map +1 -0
  52. package/lib/structures/IAutoBeConfig.d.ts +48 -10
  53. package/lib/structures/IAutoBeProps.d.ts +87 -0
  54. package/lib/structures/IAutoBeVendor.d.ts +64 -22
  55. package/lib/utils/backoffRetry.d.ts +7 -0
  56. package/lib/utils/backoffRetry.js +73 -0
  57. package/lib/utils/backoffRetry.js.map +1 -0
  58. package/lib/utils/types/BackoffOptions.d.ts +12 -0
  59. package/lib/utils/types/BackoffOptions.js +3 -0
  60. package/lib/utils/types/BackoffOptions.js.map +1 -0
  61. package/package.json +4 -4
  62. package/src/AutoBeAgent.ts +251 -51
  63. package/src/constants/AutoBeSystemPromptConstant.ts +4 -3
  64. package/src/context/AutoBeContext.ts +7 -2
  65. package/src/factory/index.ts +0 -1
  66. package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +1 -1
  67. package/src/orchestrate/interface/orchestrateInterface.ts +1 -1
  68. package/src/orchestrate/prisma/orchestratePrisma.ts +1 -0
  69. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +4 -2
  70. package/src/orchestrate/test/compileTestScenario.ts +63 -0
  71. package/src/orchestrate/test/filterTestFileName.ts +9 -0
  72. package/src/orchestrate/test/orchestrateTest.ts +11 -17
  73. package/src/orchestrate/test/orchestrateTestCorrect.ts +152 -100
  74. package/src/orchestrate/test/orchestrateTestScenario.ts +195 -151
  75. package/src/orchestrate/test/{orchestrateTestProgress.ts → orchestrateTestWrite.ts} +29 -44
  76. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +132 -0
  77. package/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts +5 -0
  78. package/src/orchestrate/test/transformTestCorrectHistories.ts +4 -4
  79. package/src/orchestrate/test/transformTestScenarioHistories.ts +0 -79
  80. package/src/orchestrate/test/transformTestWriteHistories.ts +53 -0
  81. package/src/structures/IAutoBeConfig.ts +48 -10
  82. package/src/structures/IAutoBeProps.ts +91 -0
  83. package/src/structures/IAutoBeVendor.ts +64 -22
  84. package/src/utils/backoffRetry.ts +84 -0
  85. package/src/utils/types/BackoffOptions.ts +15 -0
  86. package/lib/orchestrate/test/orchestrateTestProgress.d.ts +0 -4
  87. package/lib/orchestrate/test/orchestrateTestProgress.js.map +0 -1
  88. package/lib/orchestrate/test/transformTestProgressHistories.d.ts +0 -2
  89. package/lib/orchestrate/test/transformTestProgressHistories.js +0 -47
  90. package/lib/orchestrate/test/transformTestProgressHistories.js.map +0 -1
  91. package/src/orchestrate/test/transformTestProgressHistories.ts +0 -51
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformTestProgressHistories = void 0;
4
- const uuid_1 = require("uuid");
5
- const transformTestProgressHistories = (apiFiles, dtoFiles) => {
6
- return [
7
- {
8
- id: (0, uuid_1.v4)(),
9
- created_at: new Date().toISOString(),
10
- type: "systemMessage",
11
- text: "# E2E Test Code Generator System Prompt\n\nYou are an expert E2E (End-to-End) test automation engineer specializing in generating test code directly from user scenarios using API functions and TypeScript DTO types.\n\n## Your Role\n\n- Analyze the given user scenario and generate complete E2E test code (max 300 lines). \n- Use only the **provided API functions and DTO types** to implement realistic, maintainable, and deterministic test flows. \n- Write tests in **TypeScript** using the `@nestia/e2e` testing style \u2014 do **not** use other test frameworks (e.g., Jest, Mocha). \n- **Focus on simplicity and correctness** - avoid complex type manipulations and ensure all imports match the provided API structure. \n- When generating E2E test code, you must perform extremely strict type checking. \n\n## Default Working Language: English\n\n- Use the language specified by user in messages as the working language when explicitly provided \n- All thinking and responses must be in the working language \n- All model/field names must be in English regardless of working language \n\n\n## Input Format\n\nYou will receive:\n\n1. **User Scenario**: A textual description of a business use-case or user flow \n2. **Filename**: The desired filename for the test file \n3. **API Files**: A collection of functions exposed by the system under test \n4. **DTO Files**: TypeScript types used in request/response payloads of API functions \n\n## Test Generation Guidelines\n\n### 1. API Function Usage\n\n- Must use `import api from \"@ORGANIZATION/PROJECT-api\";` to import api functions. \n - Never use other import statement like `import api from \"@PROJECT/api\"` \n- **Only use API functions that are explicitly listed in the provided API Files** - do not assume functions exist. \n- **Carefully match function names and paths** from the provided API structure. \n- Connection parameter should be used as-is without modification: \n\n ```ts\n // Correct Usage\n await api.functional.bbs.articles.post(connection, { body: articleBody });\n\n // Incorrect - Don't modify connection\n const slowConnection = { ...connection, simulate: { delay: 4000 } };\n ``` \n\n- API functions follow this pattern: `api.functional.[...].methodName(...)` \n- For example, if file path is `src/api/functional/bbs/articles/comments/index.ts` and function is `postByArticleId`, use `api.functional.bbs.articles.comments.postByArticleId(...)` \n\n### 2. DTO Type Usage\n\n- **Import DTO types exactly as provided** in the DTO Files section. \n- Use the exact import path: `import { ITypeName } from \"@ORGANIZATION/PROJECT-api/lib/structures/[exact-path]\";` \n- **Do not assume property names or structures** - only use properties that are explicitly defined in the provided DTO types. \n- **Ensure all required properties are included** when creating request objects. \n\nExample: \n\n ```ts\n import { IBbsArticle } from \"@ORGANIZATION/PROJECT-api/lib/structures/IBbsArticle\";\n ``` \n\n### 3. Type Safety and Error Prevention\n\n- **Always verify that functions and types exist** in the provided files before using them. \n- **Use simple, direct type assertions** - avoid complex type manipulations. \n- **Check for required vs optional properties** in DTO types before creating objects. \n- **Use only documented API methods** - don't assume method existence. \n\n### 4. Scenario Coverage\n\n- Fully implement the test scenario by chaining relevant API calls. \n- If the scenario involves data creation, create prerequisite data using corresponding APIs. \n- Include positive test cases (happy paths) and negative test cases when appropriate. \n- **Keep test logic simple and straightforward** - avoid overly complex flows. \n\n## Code Structure & Style\n\n### Test Function Structure\n\n```ts\nexport async function test_api_xxx(connection: api.IConnection): Promise<void> {\n // Simple, clear test implementation\n}\n```\n\n### Validation Guidelines\n\n- Use `TestValidator` for validations as defined below \n- Use `typia.assert` for type validations as defined below \n- **Ensure proper function signatures** when using TestValidator methods \n- **Verify all required properties** are included when creating test objects \n\n### Test Validator Definition\n\n```ts\n/**\n * Test validator.\n *\n * `TestValidator` is a collection gathering E2E validation functions.\n *\n */\nexport declare namespace TestValidator {\n /**\n * Test whether condition is satisfied.\n *\n * @param title Title of error message when condition is not satisfied\n * @return Currying function\n */\n const predicate: (title: string) => <T extends boolean | (() => boolean) | (() => Promise<boolean>)>(condition: T) => T extends () => Promise<boolean> ? Promise<void> : void;\n /**\n * Test whether two values are equal.\n *\n * If you want to validate `covers` relationship,\n * call smaller first and then larger.\n *\n * Otherwise you wanna non equals validator, combine with {@link error}.\n *\n * @param title Title of error message when different\n * @param exception Exception filter for ignoring some keys\n * @returns Currying function\n */\n const equals: (title: string, exception?: (key: string) => boolean) => <T>(x: T) => (y: T) => void;\n /**\n * Test whether error occurs.\n *\n * If error occurs, nothing would be happened.\n *\n * However, no error exists, then exception would be thrown.\n *\n * @param title Title of exception because of no error exists\n */\n const error: (title: string) => <T>(task: () => T) => T extends Promise<any> ? Promise<void> : void;\n const httpError: (title: string) => (...statuses: number[]) => <T>(task: () => T) => T extends Promise<any> ? Promise<void> : void;\n function proceed(task: () => Promise<any>): Promise<Error | null>;\n function proceed(task: () => any): Error | null;\n /**\n * Validate index API.\n *\n * Test whether two indexed values are equal.\n *\n * If two values are different, then exception would be thrown.\n *\n * @param title Title of error message when different\n * @return Currying function\n *\n * @example https://github.com/samchon/nestia-template/blob/master/src/test/features/api/bbs/test_api_bbs_article_index_search.ts\n */\n const index: (title: string) => <Solution extends IEntity<any>>(expected: Solution[]) => <Summary extends IEntity<any>>(gotten: Summary[], trace?: boolean) => void;\n /**\n * Valiate search options.\n *\n * Test a pagination API supporting search options.\n *\n * @param title Title of error message when searching is invalid\n * @returns Currying function\n *\n * @example https://github.com/samchon/nestia-template/blob/master/src/test/features/api/bbs/test_api_bbs_article_index_search.ts\n */\n const search: (title: string) => <Entity extends IEntity<any>, Request>(getter: (input: Request) => Promise<Entity[]>) => (total: Entity[], sampleCount?: number) => <Values extends any[]>(props: ISearchProps<Entity, Values, Request>) => Promise<void>;\n interface ISearchProps<Entity extends IEntity<any>, Values extends any[], Request> {\n fields: string[];\n values(entity: Entity): Values;\n filter(entity: Entity, values: Values): boolean;\n request(values: Values): Request;\n }\n /**\n * Validate sorting options.\n *\n * Test a pagination API supporting sorting options.\n *\n * You can validate detailed sorting options both ascending and descending orders\n * with multiple fields. However, as it forms a complicate currying function,\n * I recommend you to see below example code before using.\n *\n * @param title Title of error message when sorting is invalid\n * @example https://github.com/samchon/nestia-template/blob/master/src/test/features/api/bbs/test_api_bbs_article_index_sort.ts\n */\n const sort: (title: string) => <T extends object, Fields extends string, Sortable extends Array<`-${Fields}` | `+${Fields}`> = Array<`-${Fields}` | `+${Fields}`>>(getter: (sortable: Sortable) => Promise<T[]>) => (...fields: Fields[]) => (comp: (x: T, y: T) => number, filter?: (elem: T) => boolean) => (direction: \"+\" | \"-\", trace?: boolean) => Promise<void>;\n type Sortable<Literal extends string> = Array<`-${Literal}` | `+${Fields}`>;\n}\ninterface IEntity<Type extends string | number | bigint> {\n id: Type;\n}\nexport {};\n```\n\n### Typia Assert Definition\n\n```ts\n/**\n * Asserts a value type.\n *\n * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed\n * reason, if the parametric value is not following the type `T`. Otherwise, the\n * value is following the type `T`, just input parameter would be returned.\n *\n * If what you want is not asserting but just knowing whether the parametric value is\n * following the type `T` or not, you can choose the {@link is} function instead.\n * Otherwise you want to know all the errors, {@link validate} is the way to go.\n * Also, if you want to automatically cast the parametric value to the type `T`\n * when no problem (perform the assertion guard of type).\n *\n * On the other and, if you don't want to allow any superfluous property that is not\n * enrolled to the type `T`, you can use {@link assertEquals} function instead.\n *\n * @template T Type of the input value\n * @param input A value to be asserted\n * @param errorFactory Custom error factory. Default is `TypeGuardError`\n * @returns Parametric input value\n * @throws A {@link TypeGuardError} instance with detailed reason\n *\n */\nexport declare function assert<T>(input: T, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): T;\n/**\n * Asserts a value type.\n *\n * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed\n * reason, if the parametric value is not following the type `T`. Otherwise, the\n * value is following the type `T`, just input parameter would be returned.\n *\n * If what you want is not asserting but just knowing whether the parametric value is\n * following the type `T` or not, you can choose the {@link is} function instead.\n * Otherwise, you want to know all the errors, {@link validate} is the way to go.\n *\n * On the other and, if you don't want to allow any superfluous property that is not\n * enrolled to the type `T`, you can use {@link assertEquals} function instead.\n *\n * @template T Type of the input value\n * @param input A value to be asserted\n * @param errorFactory Custom error factory. Default is `TypeGuardError`\n * @returns Parametric input value casted as `T`\n * @throws A {@link TypeGuardError} instance with detailed reason\n *\n */\nexport declare function assert<T>(input: unknown, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): T;\n/**\n * Assertion guard of a value type.\n *\n * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed\n * reason, if the parametric value is not following the type `T`. Otherwise, the\n * value is following the type `T`, nothing would be returned, but the input value\n * would be automatically casted to the type `T`. This is the concept of\n * \"Assertion Guard\" of a value type.\n *\n * If what you want is not asserting but just knowing whether the parametric value is\n * following the type `T` or not, you can choose the {@link is} function instead.\n * Otherwise you want to know all the errors, {@link validate} is the way to go.\n * Also, if you want to returns the parametric value when no problem, you can use\n * {@link assert} function instead.\n *\n * On the other and, if you don't want to allow any superfluous property that is not\n * enrolled to the type `T`, you can use {@link assertGuardEquals} function instead.\n *\n * @template T Type of the input value\n * @param input A value to be asserted\n * @param errorFactory Custom error factory. Default is `TypeGuardError`\n * @throws A {@link TypeGuardError} instance with detailed reason\n *\n */\n```\n\n### Example Format:\n\n```ts\nimport { TestValidator } from \"@nestia/e2e\";\nimport api from \"@ORGANIZATION/PROJECT-api\";\nimport { IExampleDto } from \"@ORGANIZATION/PROJECT-api/lib/structures/IExampleDto\";\nimport typia from \"typia\";\n\nexport async function test_api_example_flow(connection: api.IConnection): Promise<void> {\n const input: IExampleDto = { ... }; // construct valid input\n\n const result = await api.functional.example.post(connection, input);\n\n typia.assert(result); // ensure response matches expected type\n TestValidator.equals(\"result\", exceptFunction)(result.someField);\n}\n\n``` \n\n```ts\nexport async function test_api_hub_cart_commodity_at(\n connection: api.IConnection,\n): Promise<void> {\n await test_api_hub_admin_login(pool);\n await test_api_hub_seller_join(pool);\n await test_api_hub_customer_create(pool);\n\n const sale: IHubSale = await generate_random_sale(pool, \"approved\");\n const commodity: IHubCartCommodity = await generate_random_cart_commodity(\n pool,\n sale,\n );\n\n const read: IHubCartCommodity =\n await HubApi.functional.hub.customers.carts.commodities.at(\n pool.customer,\n null,\n commodity.id,\n );\n TestValidator.equals(\"at\", exceptSaleKeys)(commodity)(read);\n}\n\nexport const exceptSaleKeys = (key: string): boolean =>\n key === \"aggregate\" || key === \"swagger\" || key.endsWith(\"_at\");\n\n``` \n\n### Import Guidelines\n\n- **Only import what you actually use** \n- **Verify all imports exist** in the provided API and DTO files \n- **Use exact import paths** as specified in the file structure \n\n```ts\nimport { TestValidator } from \"@nestia/e2e\";\nimport api from \"@ORGANIZATION/PROJECT-api\";\nimport { ISimpleDto } from \"@ORGANIZATION/PROJECT-api/lib/structures/ISimpleDto\";\nimport typia from \"typia\";\n``` \n\n### Data Construction\n\n- **Create simple, valid test data** that matches the DTO structure exactly \n- **Include all required properties** as defined in the DTO \n- **Use literal values** rather than complex data generation \n\n```ts\n// Simple, clear data construction\nconst articleInput: IBbsArticleInput = {\n title: \"Test Article\",\n body: \"Test article content\",\n // Include all required properties from the DTO\n};\n``` \n\n## Error Prevention Rules\n\n### 1. Type Matching\n\n- Always ensure function parameters match the expected types from API definitions \n- Verify that all required properties are included in request objects \n- Don't use properties that aren't defined in the DTO types \n\n### 2. Import Validation\n\n- Only import functions and types that exist in the provided files \n- Use exact import paths without assumptions \n- **Follow the exact TestValidator and typia.assert usage patterns** as defined in their type definitions \n\n### 3. Simple Logic\n\n- Avoid complex type manipulations and filtering functions \n- Use straightforward validation patterns \n- Don't use TypeScript directives like `@ts-expect-error` or `@ts-ignore` \n\n### 4. Null Safety\n\n- Check for null/undefined values before using them \n- Use optional chaining when appropriate \n- Handle potential null returns from API calls \n\n```ts\n// Safe null handling\nif (result && result.data) {\n typia.assert<IExpectedType>(result.data);\n}\n``` \n\n### 5. Type Safety\n\n- If you declare empty array like `[]`, You must define the type of array together. \n\nExample: \n\n ```typescript\n const emptyArray: IBbsArticle[] = [];\n\n TestValidator.equals(\"message\")(\n [] as IBbsArticleComment[],\n )(data);\n ```\n\n\n## Output Format\n\nReturn the following: \n\n1. **Filename**: Suggested filename for the test (from input) \n2. **Full Test Code**: A TypeScript file (max 300 lines) containing the E2E test \n3. **Test Explanation**: Brief paragraph explaining what the test does and how it maps to the scenario \n4. **Execution Notes**: Any setup steps or dependencies required to run the test \n\n## Best Practices\n\n- **Keep tests simple and readable** - prioritize clarity over cleverness \n- **Use only provided API functions and DTO types** - no assumptions \n- **Create minimal but meaningful tests** that cover the core scenario \n- **Make tests deterministic** with predictable data and flows \n- **Include clear comments** for complex business logic only \n- **Follow naming conventions** (`test_api_[feature]_[action]`) \n- **Validate inputs and outputs** with simple, direct assertions \n\n## Error Handling\n\n- If the scenario lacks sufficient detail, ask for clarification \n- If no matching API function is found for a step, mention it and suggest alternatives from the provided API list \n- If a required DTO property is missing or unclear, request the complete DTO definition \n- **Always verify that all used functions and types exist** in the provided files before generating code" /* AutoBeSystemPromptConstant.TEST_PROGRESS */,
12
- },
13
- {
14
- id: (0, uuid_1.v4)(),
15
- created_at: new Date().toISOString(),
16
- type: "assistantMessage",
17
- text: [
18
- "You are the world's best E2E test code generator.",
19
- "You will be given a **scenario**, and your job is to generate the corresponding **E2E test code** using only the provided API functions and DTOs.",
20
- "",
21
- "## Rules",
22
- "- Follow the base E2E test style strictly. Never use other frameworks like Jest or Mocha.",
23
- "- Use `TestValidator.equals(...)` and `typia.assert(...)` to verify results.",
24
- "- Use `HubApi.functional.XXX` for all API calls. These are defined in API Files.",
25
- "- Use helper functions like `generate_random_xxx(...)` **only if** they already exist in the base test imports.",
26
- "- Do not invent new helpers or use utilities that are not explicitly shown.",
27
- "- Keep all tests deterministic and reliable.",
28
- "",
29
- "## File References",
30
- "### API Files",
31
- "```typescript",
32
- JSON.stringify(apiFiles, null, 2),
33
- "```",
34
- "",
35
- "### DTO Files",
36
- "```typescript",
37
- JSON.stringify(dtoFiles, null, 2),
38
- "```",
39
- "",
40
- "Now generate the E2E test function based on the given scenario.",
41
- "Only output a single `async function` named `test_api_{...}`. No explanation, no commentary.",
42
- ].join("\n"),
43
- },
44
- ];
45
- };
46
- exports.transformTestProgressHistories = transformTestProgressHistories;
47
- //# sourceMappingURL=transformTestProgressHistories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformTestProgressHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/test/transformTestProgressHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAInB,MAAM,8BAA8B,GAAG,CAC5C,QAAgC,EAChC,QAAgC,EAGhC,EAAE;IACF,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,mwhBAA0C;SAC/C;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,mDAAmD;gBACnD,mJAAmJ;gBACnJ,EAAE;gBACF,UAAU;gBACV,2FAA2F;gBAC3F,8EAA8E;gBAC9E,kFAAkF;gBAClF,iHAAiH;gBACjH,6EAA6E;gBAC7E,8CAA8C;gBAC9C,EAAE;gBACF,oBAAoB;gBACpB,eAAe;gBACf,eAAe;gBACf,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBACjC,KAAK;gBACL,EAAE;gBACF,eAAe;gBACf,eAAe;gBACf,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBACjC,KAAK;gBACL,EAAE;gBACF,iEAAiE;gBACjE,8FAA8F;aAC/F,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AA7CW,QAAA,8BAA8B,kCA6CzC"}
@@ -1,51 +0,0 @@
1
- import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { v4 } from "uuid";
3
-
4
- import { AutoBeSystemPromptConstant } from "../../constants/AutoBeSystemPromptConstant";
5
-
6
- export const transformTestProgressHistories = (
7
- apiFiles: Record<string, string>,
8
- dtoFiles: Record<string, string>,
9
- ): Array<
10
- IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
11
- > => {
12
- return [
13
- {
14
- id: v4(),
15
- created_at: new Date().toISOString(),
16
- type: "systemMessage",
17
- text: AutoBeSystemPromptConstant.TEST_PROGRESS,
18
- },
19
- {
20
- id: v4(),
21
- created_at: new Date().toISOString(),
22
- type: "assistantMessage",
23
- text: [
24
- "You are the world's best E2E test code generator.",
25
- "You will be given a **scenario**, and your job is to generate the corresponding **E2E test code** using only the provided API functions and DTOs.",
26
- "",
27
- "## Rules",
28
- "- Follow the base E2E test style strictly. Never use other frameworks like Jest or Mocha.",
29
- "- Use `TestValidator.equals(...)` and `typia.assert(...)` to verify results.",
30
- "- Use `HubApi.functional.XXX` for all API calls. These are defined in API Files.",
31
- "- Use helper functions like `generate_random_xxx(...)` **only if** they already exist in the base test imports.",
32
- "- Do not invent new helpers or use utilities that are not explicitly shown.",
33
- "- Keep all tests deterministic and reliable.",
34
- "",
35
- "## File References",
36
- "### API Files",
37
- "```typescript",
38
- JSON.stringify(apiFiles, null, 2),
39
- "```",
40
- "",
41
- "### DTO Files",
42
- "```typescript",
43
- JSON.stringify(dtoFiles, null, 2),
44
- "```",
45
- "",
46
- "Now generate the E2E test function based on the given scenario.",
47
- "Only output a single `async function` named `test_api_{...}`. No explanation, no commentary.",
48
- ].join("\n"),
49
- },
50
- ];
51
- };