@autobe/rpc 0.0.0 → 0.3.9

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 (136) hide show
  1. package/lib/{rpc/src/AutoBeRpcService.d.ts → AutoBeRpcService.d.ts} +1 -1
  2. package/lib/AutoBeRpcService.js.map +1 -0
  3. package/lib/index.js.map +1 -0
  4. package/package.json +3 -3
  5. package/src/AutoBeRpcService.ts +1 -2
  6. package/lib/agent/src/AutoBeAgent.d.ts +0 -31
  7. package/lib/agent/src/AutoBeAgent.js +0 -180
  8. package/lib/agent/src/AutoBeAgent.js.map +0 -1
  9. package/lib/agent/src/analyze/AnalyzeAgent.d.ts +0 -24
  10. package/lib/agent/src/analyze/AnalyzeAgent.js +0 -143
  11. package/lib/agent/src/analyze/AnalyzeAgent.js.map +0 -1
  12. package/lib/agent/src/analyze/CreateReviewerAgent.d.ts +0 -16
  13. package/lib/agent/src/analyze/CreateReviewerAgent.js +0 -97
  14. package/lib/agent/src/analyze/CreateReviewerAgent.js.map +0 -1
  15. package/lib/agent/src/analyze/Planning.d.ts +0 -63
  16. package/lib/agent/src/analyze/Planning.js +0 -39
  17. package/lib/agent/src/analyze/Planning.js.map +0 -1
  18. package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +0 -14
  19. package/lib/agent/src/constants/AutoBeSystemPromptConstant.js +0 -4
  20. package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +0 -1
  21. package/lib/agent/src/context/AutoBeContext.d.ts +0 -17
  22. package/lib/agent/src/context/AutoBeContext.js +0 -3
  23. package/lib/agent/src/context/AutoBeContext.js.map +0 -1
  24. package/lib/agent/src/context/AutoBeState.d.ts +0 -8
  25. package/lib/agent/src/context/AutoBeState.js +0 -3
  26. package/lib/agent/src/context/AutoBeState.js.map +0 -1
  27. package/lib/agent/src/context/AutoBeTokenUsage.d.ts +0 -2
  28. package/lib/agent/src/context/AutoBeTokenUsage.js +0 -6
  29. package/lib/agent/src/context/AutoBeTokenUsage.js.map +0 -1
  30. package/lib/agent/src/context/IAutoBeApplication.d.ts +0 -107
  31. package/lib/agent/src/context/IAutoBeApplication.js +0 -3
  32. package/lib/agent/src/context/IAutoBeApplication.js.map +0 -1
  33. package/lib/agent/src/context/IAutoBeApplicationProps.d.ts +0 -26
  34. package/lib/agent/src/context/IAutoBeApplicationProps.js +0 -3
  35. package/lib/agent/src/context/IAutoBeApplicationProps.js.map +0 -1
  36. package/lib/agent/src/context/IAutoBeApplicationResult.d.ts +0 -3
  37. package/lib/agent/src/context/IAutoBeApplicationResult.js +0 -3
  38. package/lib/agent/src/context/IAutoBeApplicationResult.js.map +0 -1
  39. package/lib/agent/src/context/assertSchemaModel.d.ts +0 -2
  40. package/lib/agent/src/context/assertSchemaModel.js +0 -15
  41. package/lib/agent/src/context/assertSchemaModel.js.map +0 -1
  42. package/lib/agent/src/factory/createAgenticaHistory.d.ts +0 -7
  43. package/lib/agent/src/factory/createAgenticaHistory.js +0 -26
  44. package/lib/agent/src/factory/createAgenticaHistory.js.map +0 -1
  45. package/lib/agent/src/factory/createAutoBeApplication.d.ts +0 -7
  46. package/lib/agent/src/factory/createAutoBeApplication.js +0 -40
  47. package/lib/agent/src/factory/createAutoBeApplication.js.map +0 -1
  48. package/lib/agent/src/factory/createAutoBeState.d.ts +0 -3
  49. package/lib/agent/src/factory/createAutoBeState.js +0 -16
  50. package/lib/agent/src/factory/createAutoBeState.js.map +0 -1
  51. package/lib/agent/src/factory/index.d.ts +0 -2
  52. package/lib/agent/src/factory/index.js +0 -19
  53. package/lib/agent/src/factory/index.js.map +0 -1
  54. package/lib/agent/src/factory/invertOpenApiDocument.d.ts +0 -3
  55. package/lib/agent/src/factory/invertOpenApiDocument.js +0 -51
  56. package/lib/agent/src/factory/invertOpenApiDocument.js.map +0 -1
  57. package/lib/agent/src/index.d.ts +0 -9
  58. package/lib/agent/src/index.js +0 -49
  59. package/lib/agent/src/index.js.map +0 -1
  60. package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.d.ts +0 -2
  61. package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js +0 -46
  62. package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js.map +0 -1
  63. package/lib/agent/src/orchestrate/index.d.ts +0 -5
  64. package/lib/agent/src/orchestrate/index.js +0 -14
  65. package/lib/agent/src/orchestrate/index.js.map +0 -1
  66. package/lib/agent/src/orchestrate/interface/OpenApiEndpointComparator.d.ts +0 -5
  67. package/lib/agent/src/orchestrate/interface/OpenApiEndpointComparator.js +0 -16
  68. package/lib/agent/src/orchestrate/interface/OpenApiEndpointComparator.js.map +0 -1
  69. package/lib/agent/src/orchestrate/interface/orchestrateInterface.d.ts +0 -5
  70. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +0 -61
  71. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +0 -1
  72. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComponents.d.ts +0 -4
  73. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComponents.js +0 -208
  74. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComponents.js.map +0 -1
  75. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +0 -4
  76. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +0 -86
  77. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +0 -1
  78. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.d.ts +0 -4
  79. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +0 -154
  80. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +0 -1
  81. package/lib/agent/src/orchestrate/interface/transformInterfaceHistories.d.ts +0 -3
  82. package/lib/agent/src/orchestrate/interface/transformInterfaceHistories.js +0 -94
  83. package/lib/agent/src/orchestrate/interface/transformInterfaceHistories.js.map +0 -1
  84. package/lib/agent/src/orchestrate/orchestrateAnalyze.d.ts +0 -6
  85. package/lib/agent/src/orchestrate/orchestrateAnalyze.js +0 -76
  86. package/lib/agent/src/orchestrate/orchestrateAnalyze.js.map +0 -1
  87. package/lib/agent/src/orchestrate/orchestrateRealize.d.ts +0 -5
  88. package/lib/agent/src/orchestrate/orchestrateRealize.js +0 -19
  89. package/lib/agent/src/orchestrate/orchestrateRealize.js.map +0 -1
  90. package/lib/agent/src/orchestrate/orchestrateTest.d.ts +0 -5
  91. package/lib/agent/src/orchestrate/orchestrateTest.js +0 -19
  92. package/lib/agent/src/orchestrate/orchestrateTest.js.map +0 -1
  93. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.d.ts +0 -5
  94. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +0 -103
  95. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +0 -1
  96. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCompiler.d.ts +0 -6
  97. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCompiler.js +0 -127
  98. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCompiler.js.map +0 -1
  99. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +0 -5
  100. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +0 -80
  101. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +0 -1
  102. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchema.d.ts +0 -7
  103. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchema.js +0 -124
  104. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchema.js.map +0 -1
  105. package/lib/agent/src/orchestrate/prisma/transformPrismaCompilerHistories.d.ts +0 -3
  106. package/lib/agent/src/orchestrate/prisma/transformPrismaCompilerHistories.js +0 -44
  107. package/lib/agent/src/orchestrate/prisma/transformPrismaCompilerHistories.js.map +0 -1
  108. package/lib/agent/src/orchestrate/prisma/transformPrismaComponentsHistories.d.ts +0 -3
  109. package/lib/agent/src/orchestrate/prisma/transformPrismaComponentsHistories.js +0 -42
  110. package/lib/agent/src/orchestrate/prisma/transformPrismaComponentsHistories.js.map +0 -1
  111. package/lib/agent/src/orchestrate/prisma/transformPrismaSchemaHistories.d.ts +0 -3
  112. package/lib/agent/src/orchestrate/prisma/transformPrismaSchemaHistories.js +0 -46
  113. package/lib/agent/src/orchestrate/prisma/transformPrismaSchemaHistories.js.map +0 -1
  114. package/lib/agent/src/structures/IAutoBeConfig.d.ts +0 -24
  115. package/lib/agent/src/structures/IAutoBeConfig.js +0 -3
  116. package/lib/agent/src/structures/IAutoBeConfig.js.map +0 -1
  117. package/lib/agent/src/structures/IAutoBeProps.d.ts +0 -11
  118. package/lib/agent/src/structures/IAutoBeProps.js +0 -3
  119. package/lib/agent/src/structures/IAutoBeProps.js.map +0 -1
  120. package/lib/agent/src/structures/IAutoBeVendor.d.ts +0 -2
  121. package/lib/agent/src/structures/IAutoBeVendor.js +0 -3
  122. package/lib/agent/src/structures/IAutoBeVendor.js.map +0 -1
  123. package/lib/agent/src/utils/StringUtil.d.ts +0 -4
  124. package/lib/agent/src/utils/StringUtil.js +0 -43
  125. package/lib/agent/src/utils/StringUtil.js.map +0 -1
  126. package/lib/agent/src/utils/divideArray.d.ts +0 -4
  127. package/lib/agent/src/utils/divideArray.js +0 -19
  128. package/lib/agent/src/utils/divideArray.js.map +0 -1
  129. package/lib/agent/src/utils/emplaceMap.d.ts +0 -1
  130. package/lib/agent/src/utils/emplaceMap.js +0 -13
  131. package/lib/agent/src/utils/emplaceMap.js.map +0 -1
  132. package/lib/rpc/src/AutoBeRpcService.js.map +0 -1
  133. package/lib/rpc/src/index.js.map +0 -1
  134. /package/lib/{rpc/src/AutoBeRpcService.js → AutoBeRpcService.js} +0 -0
  135. /package/lib/{rpc/src/index.d.ts → index.d.ts} +0 -0
  136. /package/lib/{rpc/src/index.js → index.js} +0 -0
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.realize = exports.test = exports.prisma = exports.interface = exports.analyze = void 0;
4
- var orchestrateAnalyze_1 = require("./orchestrateAnalyze");
5
- Object.defineProperty(exports, "analyze", { enumerable: true, get: function () { return orchestrateAnalyze_1.orchestrateAnalyze; } });
6
- var orchestrateInterface_1 = require("./interface/orchestrateInterface");
7
- Object.defineProperty(exports, "interface", { enumerable: true, get: function () { return orchestrateInterface_1.orchestrateInterface; } });
8
- var orchestratePrisma_1 = require("./prisma/orchestratePrisma");
9
- Object.defineProperty(exports, "prisma", { enumerable: true, get: function () { return orchestratePrisma_1.orchestratePrisma; } });
10
- var orchestrateTest_1 = require("./orchestrateTest");
11
- Object.defineProperty(exports, "test", { enumerable: true, get: function () { return orchestrateTest_1.orchestrateTest; } });
12
- var orchestrateRealize_1 = require("./orchestrateRealize");
13
- Object.defineProperty(exports, "realize", { enumerable: true, get: function () { return orchestrateRealize_1.orchestrateRealize; } });
14
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../agent/src/orchestrate/index.ts"],"names":[],"mappings":";;;AAAA,2DAAqE;AAA5D,6GAAA,kBAAkB,OAAW;AACtC,yEAAqF;AAA5E,iHAAA,oBAAoB,OAAa;AAC1C,gEAAyE;AAAhE,2GAAA,iBAAiB,OAAU;AACpC,qDAA4D;AAAnD,uGAAA,eAAe,OAAQ;AAChC,2DAAqE;AAA5D,6GAAA,kBAAkB,OAAW"}
@@ -1,5 +0,0 @@
1
- import { AutoBeOpenApi } from "@autobe/interface";
2
- export declare namespace OpenApiEndpointComparator {
3
- function hashCode(e: AutoBeOpenApi.IEndpoint): number;
4
- function equals(x: AutoBeOpenApi.IEndpoint, y: AutoBeOpenApi.IEndpoint): boolean;
5
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpenApiEndpointComparator = void 0;
4
- const tstl_1 = require("tstl");
5
- var OpenApiEndpointComparator;
6
- (function (OpenApiEndpointComparator) {
7
- function hashCode(e) {
8
- return (0, tstl_1.hash)(e.path, e.method);
9
- }
10
- OpenApiEndpointComparator.hashCode = hashCode;
11
- function equals(x, y) {
12
- return x.path === y.path && x.method === y.method;
13
- }
14
- OpenApiEndpointComparator.equals = equals;
15
- })(OpenApiEndpointComparator || (exports.OpenApiEndpointComparator = OpenApiEndpointComparator = {}));
16
- //# sourceMappingURL=OpenApiEndpointComparator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OpenApiEndpointComparator.js","sourceRoot":"","sources":["../../../../../../agent/src/orchestrate/interface/OpenApiEndpointComparator.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAE5B,IAAiB,yBAAyB,CAWzC;AAXD,WAAiB,yBAAyB;IACxC,SAAgB,QAAQ,CAAC,CAA0B;QACjD,OAAO,IAAA,WAAI,EAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAFe,kCAAQ,WAEvB,CAAA;IAED,SAAgB,MAAM,CACpB,CAA0B,EAC1B,CAA0B;QAE1B,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC;IACpD,CAAC;IALe,gCAAM,SAKrB,CAAA;AACH,CAAC,EAXgB,yBAAyB,yCAAzB,yBAAyB,QAWzC"}
@@ -1,5 +0,0 @@
1
- import { AutoBeAssistantMessageHistory, AutoBeInterfaceHistory } from "@autobe/interface";
2
- import { ILlmSchema } from "@samchon/openapi";
3
- import { AutoBeContext } from "../../context/AutoBeContext";
4
- import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
5
- export declare const orchestrateInterface: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>) => (props: IAutoBeApplicationProps) => Promise<AutoBeAssistantMessageHistory | AutoBeInterfaceHistory>;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.orchestrateInterface = void 0;
13
- const uuid_1 = require("uuid");
14
- const orchestrateInterfaceComponents_1 = require("./orchestrateInterfaceComponents");
15
- const orchestrateInterfaceEndpoints_1 = require("./orchestrateInterfaceEndpoints");
16
- const orchestrateInterfaceOperations_1 = require("./orchestrateInterfaceOperations");
17
- const orchestrateInterface = (ctx) => (props) => __awaiter(void 0, void 0, void 0, function* () {
18
- var _a, _b, _c, _d;
19
- // ENDPOINTS
20
- const start = new Date();
21
- const init = yield (0, orchestrateInterfaceEndpoints_1.orchestrateInterfaceEndpoints)(ctx);
22
- if (init.type === "assistantMessage") {
23
- ctx.dispatch(init);
24
- ctx.histories().push(init);
25
- return init;
26
- }
27
- else
28
- ctx.dispatch(init);
29
- // OPERATIONS
30
- const operations = yield (0, orchestrateInterfaceOperations_1.orchestrateInterfaceOperations)(ctx, init.endpoints);
31
- // COMPONENTS
32
- const components = yield (0, orchestrateInterfaceComponents_1.orchestrateInterfaceComponents)(ctx, operations);
33
- // TYPESCRIPT CODE GENERATION
34
- const document = {
35
- operations,
36
- components,
37
- };
38
- const result = {
39
- type: "interface",
40
- id: (0, uuid_1.v4)(),
41
- document,
42
- files: yield ctx.compiler.interface(document),
43
- reason: props.reason,
44
- step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
45
- created_at: start.toISOString(),
46
- completed_at: new Date().toISOString(),
47
- };
48
- ctx.state().interface = result;
49
- ctx.histories().push(result);
50
- ctx.dispatch({
51
- type: "interfaceComplete",
52
- files: result.files,
53
- document: result.document,
54
- created_at: start.toISOString(),
55
- reason: props.reason,
56
- step: (_d = (_c = ctx.state().analyze) === null || _c === void 0 ? void 0 : _c.step) !== null && _d !== void 0 ? _d : 0,
57
- });
58
- return result;
59
- });
60
- exports.orchestrateInterface = orchestrateInterface;
61
- //# sourceMappingURL=orchestrateInterface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestrateInterface.js","sourceRoot":"","sources":["../../../../../../agent/src/orchestrate/interface/orchestrateInterface.ts"],"names":[],"mappings":";;;;;;;;;;;;AAQA,+BAA0B;AAI1B,qFAAkF;AAClF,mFAAgF;AAChF,qFAAkF;AAE3E,MAAM,oBAAoB,GAC/B,CAAiC,GAAyB,EAAE,EAAE,CAC9D,CACE,KAA8B,EACmC,EAAE;;IACnE,YAAY;IACZ,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;IAC/B,MAAM,IAAI,GACR,MAAM,IAAA,6DAA6B,EAAC,GAAG,CAAC,CAAC;IAC3C,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;QACrC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnB,GAAG,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;;QAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE1B,aAAa;IACb,MAAM,UAAU,GACd,MAAM,IAAA,+DAA8B,EAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAE5D,aAAa;IACb,MAAM,UAAU,GACd,MAAM,IAAA,+DAA8B,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAExD,6BAA6B;IAC7B,MAAM,QAAQ,GAA4B;QACxC,UAAU;QACV,UAAU;KACX,CAAC;IACF,MAAM,MAAM,GAA2B;QACrC,IAAI,EAAE,WAAW;QACjB,EAAE,EAAE,IAAA,SAAE,GAAE;QACR,QAAQ;QACR,KAAK,EAAE,MAAM,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC7C,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,IAAI,mCAAI,CAAC;QACpC,UAAU,EAAE,KAAK,CAAC,WAAW,EAAE;QAC/B,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACvC,CAAC;IACF,GAAG,CAAC,KAAK,EAAE,CAAC,SAAS,GAAG,MAAM,CAAC;IAC/B,GAAG,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7B,GAAG,CAAC,QAAQ,CAAC;QACX,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,UAAU,EAAE,KAAK,CAAC,WAAW,EAAE;QAC/B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,IAAI,mCAAI,CAAC;KACE,CAAC,CAAC;IAC1C,OAAO,MAAM,CAAC;AAChB,CAAC,CAAA,CAAC;AAjDS,QAAA,oBAAoB,wBAiD7B"}
@@ -1,4 +0,0 @@
1
- import { AutoBeOpenApi } from "@autobe/interface";
2
- import { ILlmSchema } from "@samchon/openapi";
3
- import { AutoBeContext } from "../../context/AutoBeContext";
4
- export declare function orchestrateInterfaceComponents<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, operations: AutoBeOpenApi.IOperation[], capacity?: number): Promise<AutoBeOpenApi.IComponents>;
@@ -1,208 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.orchestrateInterfaceComponents = orchestrateInterfaceComponents;
16
- const core_1 = require("@agentica/core");
17
- const openapi_1 = require("@samchon/openapi");
18
- const OpenApiV3_1Emender_1 = require("@samchon/openapi/lib/converters/OpenApiV3_1Emender");
19
- const typia_1 = __importDefault(require("typia"));
20
- const assertSchemaModel_1 = require("../../context/assertSchemaModel");
21
- const divideArray_1 = require("../../utils/divideArray");
22
- const transformInterfaceHistories_1 = require("./transformInterfaceHistories");
23
- function orchestrateInterfaceComponents(ctx_1, operations_1) {
24
- return __awaiter(this, arguments, void 0, function* (ctx, operations, capacity = 12) {
25
- const typeNames = new Set();
26
- for (const op of operations) {
27
- if (op.requestBody !== null)
28
- typeNames.add(op.requestBody.typeName);
29
- if (op.responseBody !== null)
30
- typeNames.add(op.responseBody.typeName);
31
- }
32
- const matrix = (0, divideArray_1.divideArray)({
33
- array: Array.from(typeNames),
34
- capacity,
35
- });
36
- let progress = 0;
37
- const x = {
38
- schemas: {},
39
- };
40
- for (const y of yield Promise.all(matrix.map((it) => __awaiter(this, void 0, void 0, function* () {
41
- var _a, _b;
42
- const row = yield divideAndConquer(ctx, operations, it, 3, (count) => {
43
- progress += count;
44
- });
45
- ctx.dispatch({
46
- type: "interfaceComponents",
47
- components: row,
48
- completed: progress,
49
- total: typeNames.size,
50
- step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
51
- created_at: new Date().toISOString(),
52
- });
53
- return row;
54
- })))) {
55
- Object.assign(x.schemas, y.schemas);
56
- if (y.authorization)
57
- x.authorization = y.authorization;
58
- }
59
- return x;
60
- });
61
- }
62
- function divideAndConquer(ctx, operations, typeNames, retry, progress) {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- const remained = new Set(typeNames);
65
- const components = {
66
- schemas: {},
67
- };
68
- for (let i = 0; i < retry; ++i) {
69
- if (remained.size === 0)
70
- break;
71
- const before = remained.size;
72
- const newbie = yield process(ctx, operations, components, remained);
73
- for (const key of Object.keys(newbie.schemas)) {
74
- components.schemas[key] = newbie.schemas[key];
75
- remained.delete(key);
76
- }
77
- if (before - remained.size !== 0)
78
- progress(before - remained.size);
79
- }
80
- return components;
81
- });
82
- }
83
- function process(ctx, operations, oldbie, remained) {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- var _a;
86
- const pointer = {
87
- value: null,
88
- };
89
- const agentica = new core_1.MicroAgentica({
90
- model: ctx.model,
91
- vendor: ctx.vendor,
92
- config: Object.assign(Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})), { executor: {
93
- describe: null,
94
- } }),
95
- histories: [
96
- ...(0, transformInterfaceHistories_1.transformInterfaceHistories)(ctx.state(), "# AutoAPI Schema Agent System Prompt\n\nYou are AutoAPI Schema Agent, an expert in creating comprehensive schema components for OpenAPI specifications in the `AutoBeOpenApi.IDocument` format. Your specialized role focuses on the third phase of a multi-agent orchestration process for large-scale API design.\n\nYour mission is to analyze the provided API operations, paths, methods, Prisma schema files, and ERD diagrams to construct a complete and consistent set of component schemas that accurately represent all entities and their relationships in the system.\n\n## 1. Context and Your Role in the Multi-Agent Process\n\nYou are the third agent in a three-phase process:\n1. **Phase 1** (completed): Analysis of requirements, Prisma schema, and ERD to define API paths and methods\n2. **Phase 2** (completed): Creation of detailed API operations based on the defined paths and methods\n3. **Phase 3** (your role): Construction of comprehensive component schemas for all entities\n\nYou will receive:\n- The complete list of API operations from Phase 2\n- The original Prisma schema with detailed comments\n- ERD diagrams in Mermaid format\n- Requirement analysis documents\n\n## 2. Primary Responsibilities\n\nYour specific tasks are:\n\n1. **Extract All Entity Types**: Analyze all API operations and identify every distinct entity type referenced\n2. **Define Complete Schema Components**: Create detailed schema definitions for every entity and its variants\n3. **Maintain Type Naming Conventions**: Follow the established type naming patterns\n4. **Ensure Schema Completeness**: Verify that ALL entities in the Prisma schema have corresponding component schemas\n5. **Create Type Variants**: Define all necessary type variants for each entity (.ICreate, .IUpdate, .ISummary, etc.)\n6. **Document Thoroughly**: Provide comprehensive descriptions for all schema components\n7. **Validate Consistency**: Ensure schema definitions align with API operations\n8. **Use Named References Only**: NEVER use inline/anonymous object definitions - ALL object types must be defined as named types in the components.schemas section and referenced using $ref\n\n## 3. Schema Design Principles\n\n### 3.1. Type Naming Conventions\n\n- **Main Entity Types**: Use `IEntityName` format\n- **Operation-Specific Types**:\n - `IEntityName.ICreate`: Request body for creation operations (POST)\n - `IEntityName.IUpdate`: Request body for update operations (PUT or PATCH)\n - `IEntityName.ISummary`: Simplified response version with essential properties\n - `IEntityName.IRequest`: Request parameters for list operations (search/filter/pagination)\n - `IEntityName.IAbridge`: Intermediate view with more detail than Summary but less than full entity\n - `IEntityName.IInvert`: Alternative representation of an entity from a different perspective\n- **Container Types**: \n - `IPageIEntityName`: Paginated results container (use the standard IPage structure)\n\n### 3.2. Schema Definition Requirements\n\n- **Completeness**: Include ALL properties from the Prisma schema for each entity\n- **Type Accuracy**: Map Prisma types to appropriate OpenAPI types and formats\n- **Required Fields**: Accurately mark required fields based on Prisma schema constraints\n- **Relationships**: Properly handle entity relationships (references to other entities)\n- **Enumerations**: Define all enum types referenced in entity schemas\n- **Detailed Documentation**: \n - Schema descriptions must reference related Prisma schema table comments\n - Property descriptions must reference related Prisma schema column comments\n - All descriptions must be organized in multiple paragraphs for better readability\n- **Named References Only**: \n - Every object type MUST be defined as a named type in the components.schemas section\n - NEVER use inline/anonymous object definitions anywhere in the schema\n - All property types that are objects must use $ref to reference a named type\n - This applies to EVERY object in the schema, including nested objects and arrays of objects\n\n### 3.3. Standard Type Definitions\n\nFor paginated results, use the standard `IPage<T>` interface:\n\n```typescript\n/**\n * A page.\n *\n * Collection of records with pagination indformation.\n *\n * @author Samchon\n */\nexport interface IPage<T extends object> {\n /**\n * Page information.\n */\n pagination: IPage.IPagination;\n\n /**\n * List of records.\n */\n data: T[];\n}\nexport namespace IPage {\n /**\n * Page information.\n */\n export interface IPagination {\n /**\n * Current page number.\n */\n current: number & tags.Type<\"uint32\">;\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit: number & tags.Type<\"uint32\">;\n\n /**\n * Total records in the database.\n */\n records: number & tags.Type<\"uint32\">;\n\n /**\n * Total pages.\n *\n * Equal to {@link records} / {@link limit} with ceiling.\n */\n pages: number & tags.Type<\"uint32\">;\n }\n\n /**\n * Page request data\n */\n export interface IRequest {\n /**\n * Page number.\n */\n page?: null | (number & tags.Type<\"uint32\">);\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit?: null | (number & tags.Type<\"uint32\">);\n }\n}\n```\n\n## 4. Implementation Strategy\n\n### 4.1. Comprehensive Entity Identification\n\n1. **Extract All Entity References**:\n - Analyze all API operation paths for entity identifiers\n - Examine request and response bodies in API operations\n - Review the Prisma schema to identify ALL entities\n\n2. **Create Entity Tracking System**:\n - List ALL entities from the Prisma schema\n - Cross-reference with entities mentioned in API operations\n - Identify any entities that might be missing schema definitions\n\n### 4.2. Schema Definition Process\n\n1. **For Each Entity**:\n - Define the main entity schema (`IEntityName`)\n - Create all necessary variant types based on API operations\n - Ensure all properties are documented with descriptions from Prisma schema\n - Mark required fields based on Prisma schema constraints\n\n2. **For Relationship Handling**:\n - Identify all relationships from the ERD and Prisma schema\n - Define appropriate property types for relationships (IDs, nested objects, arrays)\n - Document relationship constraints and cardinality\n\n3. **For Variant Types**:\n - Create `.ICreate` types with appropriate required/optional fields for creation\n - Define `.IUpdate` types with all fields made optional for updates\n - Build `.ISummary` types with essential fields for list views\n - Define `.IRequest` types with search/filter/sort parameters\n\n### 4.3. Schema Completeness Verification\n\n1. **Entity Coverage Check**:\n - Verify every entity in the Prisma schema has at least one schema definition\n - Check that all entities referenced in API operations have schema definitions\n\n2. **Property Coverage Check**:\n - Ensure all properties from the Prisma schema are included in entity schemas\n - Verify property types align with Prisma schema definitions\n\n3. **Variant Type Verification**:\n - Confirm necessary variant types exist based on API operations\n - Ensure variant types have appropriate property subsets and constraints\n\n## 5. Documentation Quality Requirements\n\n### 5.1. **Schema Type Descriptions**\n- Must reference related Prisma schema table description comments\n- Must be extremely detailed and comprehensive\n- Must be organized in multiple paragraphs\n- Should explain the entity's role in the business domain\n- Should describe relationships with other entities\n\n### 5.2. **Property Descriptions**\n- Must reference related Prisma schema column description comments\n- Must explain the purpose, constraints, and format of each property\n- Should note business rules that apply to the property\n- Should provide examples when helpful\n- Should use multiple paragraphs for complex properties\n\n## 6. Output Format\n\nYour output should be the complete `components` section of the OpenAPI document:\n\n```typescript\nconst components: OpenApi.IComponents = {\n schemas: {\n // Main entity types\n IEntityName: { \n type: \"object\", \n properties: {\n propertyName: {\n type: \"string\",\n description: \"Detailed property description referencing Prisma schema column comments.\\n\\nMultiple paragraphs where appropriate.\"\n }\n // ...more properties\n },\n required: [...],\n description: \"Extremely detailed explanation about IEntityName referencing Prisma schema table comments.\\n\\nMultiple paragraphs focusing on different aspects of the entity.\",\n },\n // Variant types\n \"IEntityName.ICreate\": { ... },\n \"IEntityName.IUpdate\": { ... },\n \"IEntityName.ISummary\": { ... },\n \"IEntityName.IRequest\": { ... },\n \n // Repeat for ALL entities\n \n // Standard types\n \"IPage\": { ... },\n \"IPage.IPagination\": { ... },\n \"IPage.IRequest\": { ... },\n \n // Enumerations\n \"EEnumName\": { ... }\n }\n}\n```\n\n## 7. Critical Success Factors\n\n### 7.1. Absolute Completeness Principles\n\n- **Process ALL Entities**: EVERY entity defined in the Prisma schema MUST have corresponding schema components.\n- **Complete Property Coverage**: ALL properties of each entity MUST be included in schema definitions.\n- **Variant Type Comprehensiveness**: ALL necessary variant types MUST be defined based on API operations.\n- **No Simplification**: Complex entities or relationships MUST be faithfully represented without simplification.\n- **Verification of Completeness**: Before final output, verify that ALL entities and properties have been defined.\n\n### 7.2. High-Volume Processing Strategy\n\n- **Batch Processing**: If there are many entities, process them in groups, but ALL groups MUST be completed.\n- **No Prioritization**: ALL entities and their properties have equal importance and must be processed.\n- **Systematic Approach**: Use a methodical approach to ensure no entity or property is overlooked.\n- **Detailed Tracking**: Maintain a tracking system to verify completeness of schema definitions.\n\n### 7.3. Critical Warnings\n\n- **Partial Implementation Prohibited**: \"Defining schemas for only some entities and omitting others\" is a CRITICAL ERROR.\n- **Property Omission Prohibited**: \"Including only some properties of an entity\" is a SERIOUS ERROR.\n- **No Simplification**: \"Simplifying complex entities or relationships\" is NOT ACCEPTABLE.\n- **Ignore Capacity Limitations**: Processing only some entities due to their quantity is a SERIOUS ERROR.\n- **Named Types Required**: Using inline/anonymous object definitions instead of named type references ($ref) is a CRITICAL ERROR. EVERY object type must be defined in the components.schemas section and referenced by name.\n\n## 8. Execution Process\n\n1. **Initialization**:\n - Analyze all input data (API operations, Prisma schema, ERD)\n - Create a complete inventory of entities and their relationships\n\n2. **Schema Development**:\n - Systematically define schema components for each entity and its variants\n - Document all components and properties thoroughly\n\n3. **Verification**:\n - Validate completeness against the Prisma schema\n - Verify consistency with API operations\n - Ensure all relationships are properly handled\n\n4. **Output Generation**:\n - Produce the complete `components` section in the required format\n - Verify the output meets all quality and completeness requirements\n\nRemember that your role is CRITICAL to the success of the entire API design process. The schemas you define will be the foundation for ALL data exchange in the API. Thoroughness, accuracy, and completeness are your highest priorities.\n\n## 9. Integration with Previous Phases\n\n- Ensure your schema components align perfectly with the API operations defined in Phase 2\n- Reference the same entities and property names used in the API paths from Phase 1\n- Maintain consistency in naming, typing, and structure throughout the entire API design\n\n## 10. Final Output Format\n\nYour final output should be the complete `components` section that can be directly integrated with the API operations from Phase 2 to form a complete `AutoBeOpenApi.IDocument` object.\n\nAlways aim to create schema components that are intuitive, well-documented, and accurately represent the business domain. Your schema definitions should meet ALL business requirements while being extensible and maintainable. Remember to define components for EVERY SINGLE independent entity table in the Prisma schema. NO ENTITY OR PROPERTY SHOULD BE OMITTED FOR ANY REASON." /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA */),
97
- {
98
- type: "assistantMessage",
99
- text: [
100
- "Here is the OpenAPI operations generated by phase 2.",
101
- "",
102
- "```json",
103
- JSON.stringify(operations),
104
- "```",
105
- ].join("\n"),
106
- },
107
- ],
108
- tokenUsage: ctx.usage(),
109
- controllers: [
110
- createApplication({
111
- model: ctx.model,
112
- build: (components) => __awaiter(this, void 0, void 0, function* () {
113
- pointer.value = components;
114
- }),
115
- pointer,
116
- }),
117
- ],
118
- });
119
- agentica.on("request", (event) => __awaiter(this, void 0, void 0, function* () {
120
- event.body.tool_choice = "required";
121
- }));
122
- const already = Object.keys(oldbie.schemas);
123
- yield agentica.conversate([
124
- "Make type components please.",
125
- "",
126
- "Here is the list of request/response bodies' type names from",
127
- "OpenAPI operations. Make type components of them. If more object",
128
- "types are required during making the components, please make them",
129
- "too.",
130
- "",
131
- ...Array.from(remained).map((k) => `- \`${k}\``),
132
- ...(already.length !== 0
133
- ? [
134
- "",
135
- "> By the way, here is the list of components schemas what you've",
136
- "> already made. So, you don't need to make them again.",
137
- ">",
138
- ...already.map((k) => `> - \`${k}\``),
139
- ]
140
- : []),
141
- ].join("\n"));
142
- if (pointer.value === null) {
143
- // never be happened
144
- throw new Error("Failed to create components.");
145
- }
146
- return OpenApiV3_1Emender_1.OpenApiV3_1Emender.convertComponents(pointer.value);
147
- });
148
- }
149
- function createApplication(props) {
150
- (0, assertSchemaModel_1.assertSchemaModel)(props.model);
151
- const application = collection[props.model];
152
- const validate = (next) => {
153
- const result = typia_1.default.validate(next);
154
- if (result.success === false)
155
- return result;
156
- props.pointer.value = result.data.components;
157
- const errors = [];
158
- for (const value of Object.values(result.data.components.schemas)) {
159
- openapi_1.OpenApiTypeChecker.visit({
160
- components: result.data.components,
161
- schema: value,
162
- closure: (v) => {
163
- var _a;
164
- if (openapi_1.OpenApiTypeChecker.isReference(v)) {
165
- const key = v.$ref.split("/").at(-1);
166
- if (((_a = result.data.components.schemas) === null || _a === void 0 ? void 0 : _a[key]) === undefined)
167
- errors.push({
168
- path: `components.schemas.${key}`,
169
- expected: "AutoBeOpenApi.IJsonSchemaDescriptive",
170
- value: "undefined",
171
- });
172
- }
173
- },
174
- });
175
- }
176
- if (errors.length !== 0)
177
- return {
178
- success: false,
179
- data: result.data,
180
- errors,
181
- };
182
- return result;
183
- };
184
- application.functions[0].validate = validate;
185
- return {
186
- protocol: "class",
187
- name: "interface",
188
- application,
189
- execute: {
190
- makeComponents: (next) => __awaiter(this, void 0, void 0, function* () {
191
- yield props.build(next.components);
192
- return {
193
- success: true,
194
- };
195
- }),
196
- },
197
- };
198
- }
199
- const claude = typia_1.default.llm.application();
200
- const collection = {
201
- chatgpt: typia_1.default.llm.application(),
202
- claude,
203
- llama: claude,
204
- deepseek: claude,
205
- "3.1": claude,
206
- "3.0": typia_1.default.llm.application(),
207
- };
208
- //# sourceMappingURL=orchestrateInterfaceComponents.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestrateInterfaceComponents.js","sourceRoot":"","sources":["../../../../../../agent/src/orchestrate/interface/orchestrateInterfaceComponents.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAkBA,wEA+CC;AAjED,yCAAoE;AAEpE,8CAK0B;AAC1B,2FAAwF;AAExF,kDAA0B;AAI1B,uEAAoE;AACpE,yDAAsD;AACtD,+EAA4E;AAE5E,SAAsB,8BAA8B;yDAGlD,GAAyB,EACzB,UAAsC,EACtC,WAAmB,EAAE;QAErB,MAAM,SAAS,GAAgB,IAAI,GAAG,EAAE,CAAC;QACzC,KAAK,MAAM,E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;IAChB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,eAAK,CAAC,GAAG,CAAC,WAAW,EAAuB;CACpD,CAAC"}
@@ -1,4 +0,0 @@
1
- import { AutoBeAssistantMessageHistory, AutoBeInterfaceEndpointsEvent } from "@autobe/interface";
2
- import { ILlmSchema } from "@samchon/openapi";
3
- import { AutoBeContext } from "../../context/AutoBeContext";
4
- export declare function orchestrateInterfaceEndpoints<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, content?: string): Promise<AutoBeInterfaceEndpointsEvent | AutoBeAssistantMessageHistory>;
@@ -1,86 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.orchestrateInterfaceEndpoints = orchestrateInterfaceEndpoints;
16
- const core_1 = require("@agentica/core");
17
- const tstl_1 = require("tstl");
18
- const typia_1 = __importDefault(require("typia"));
19
- const uuid_1 = require("uuid");
20
- const assertSchemaModel_1 = require("../../context/assertSchemaModel");
21
- const OpenApiEndpointComparator_1 = require("./OpenApiEndpointComparator");
22
- const transformInterfaceHistories_1 = require("./transformInterfaceHistories");
23
- function orchestrateInterfaceEndpoints(ctx_1) {
24
- return __awaiter(this, arguments, void 0, function* (ctx, content = "Make API endpoints for the given assets.") {
25
- var _a, _b, _c, _d;
26
- const start = new Date();
27
- const pointer = {
28
- value: null,
29
- };
30
- const agentica = new core_1.MicroAgentica({
31
- model: ctx.model,
32
- vendor: ctx.vendor,
33
- config: Object.assign(Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})), { executor: {
34
- describe: null,
35
- } }),
36
- histories: (0, transformInterfaceHistories_1.transformInterfaceHistories)(ctx.state(), "# API Endpoint Generator System Prompt\n\n## 1. Overview\n\nYou are the API Endpoint Generator, specializing in creating comprehensive lists of REST API endpoints with their paths and HTTP methods based on requirements documents, Prisma schema files, and ERD diagrams. You must output your results by calling the `makeEndpoints()` function.\n\n## 2. Your Mission\n\nAnalyze the provided information and generate a complete array of API endpoints that includes EVERY entity from the Prisma schema and addresses ALL functional requirements. You will call the `makeEndpoints()` function with an array of endpoint definitions that contain ONLY path and method properties.\n\n## 3. Output Method\n\nYou MUST call the `makeEndpoints()` function with your results.\n\n```typescript\nmakeEndpoints({\n endpoints: [\n {\n \"path\": \"/resources\",\n \"method\": \"get\"\n },\n {\n \"path\": \"/resources/{resourceId}\",\n \"method\": \"get\"\n },\n // more endpoints...\n ],\n});\n```\n\n## 4. Endpoint Design Principles\n\n### 4.1. Follow REST principles\n\n- Resource-centric URL design (use nouns, not verbs)\n- Appropriate HTTP methods:\n - `put`: Retrieve a collection resources with searching information\n - `get`: Retrieve a single resource\n - `post`: Create new resources\n - `delete`: Remove resources\n - `patch`: Partial updates or complex queries with request bodies\n\n### 4.2. Path Formatting Rules\n\n1. **Use camelCase for all resource names in paths**\n - Example: Use `/attachmentFiles` instead of `/attachment-files`\n\n2. **Use domain prefixes with slashes**\n - Example: Use `/shopping/channels` instead of `/shopping-channels`\n - **Important**: If you identify any service-related prefix in the DB schema, use it as the global prefix for ALL API endpoints\n\n3. **Structure hierarchical relationships with slashes**\n - Example: For a child entity like \"sale-snapshots\" under \"sales\", use `/shopping/sales/snapshots` instead of `/shopping-sale-snapshots`\n\n### 4.3. Path patterns\n\n- Collection endpoints: `/domain/resources`\n- Single resource endpoints: `/domain/resources/{resourceId}`\n- Nested resources: `/domain/resources/{resourceId}/subsidiaries/{subsidiaryId}`\n\n### 4.4. Standard API operations per entity\n\nFor EACH independent entity identified in the requirements document, Prisma DB Schema, and ERD diagram, you MUST include these standard endpoints:\n\n1. `PATCH /entity-plural` - List entities with searching\n2. `GET /entity-plural/{id}` - Get specific entity\n3. `POST /entity-plural` - Create entity\n4. `PUT /entity-plural/{id}` - Update entity\n5. `DELETE /entity-plural/{id}` - Delete entity\n\n## 5. Critical Requirements\n\n- **Function Call Required**: You MUST use the `makeEndpoints()` function to submit your results\n- **Complete Coverage**: EVERY independent entity in the Prisma schema MUST have corresponding endpoints\n- **No Omissions**: Process ALL independent entities regardless of quantity\n- **Strict Output Format**: ONLY include objects with `path` and `method` properties in your function call\n- **No Additional Properties**: Do NOT include any properties beyond `path` and `method`\n\n## 6. Implementation Strategy\n\n1. Identify ALL independent entities from the Prisma schema, requirements document, and ERD\n2. Identify service-related prefixes in the DB schema to use as the global prefix for ALL API endpoints\n3. Identify domain prefixes and hierarchical relationships between entities\n4. For each independent entity:\n - Convert kebab-case names to camelCase (e.g., `attachment-files` \u2192 `attachmentFiles`)\n - Structure paths to reflect domain and hierarchical relationships\n - Generate the standard endpoints\n5. Add endpoints for relationships and complex operations\n6. Verify ALL independent entities and requirements are covered\n7. Call the `makeEndpoints()` function with your complete array\n\nYour implementation MUST be COMPLETE and EXHAUSTIVE, ensuring NO independent entity or requirement is missed, while strictly adhering to the `AutoBeOpenApi.IEndpoint` interface format. Calling the `makeEndpoints()` function is MANDATORY.\n\n## 7. Path Transformation Examples\n\n| Original Format | Improved Format | Explanation |\n|-----------------|-----------------|-------------|\n| `/attachment-files` | `/attachmentFiles` | Convert kebab-case to camelCase |\n| `/bbs-articles` | `/bbs/articles` | Separate domain prefix with slash |\n| `/bbs-article-snapshots` | `/bbs/articles/snapshots` | Reflect hierarchy in URL structure |\n| `/shopping-sale-snapshots` | `/shopping/sales/snapshots` | Both domain prefix and hierarchy properly formatted |\n\nYour implementation MUST be COMPLETE and EXHAUSTIVE, ensuring NO independent entity or requirement is missed, while strictly adhering to the `AutoBeOpenApi.IEndpoint` interface format. Calling the `makeEndpoints()` function is MANDATORY.\n\nYou're right - I removed too much of the original structure. Here's a better version that maintains the section structure while adding explanations:\n\n## 8. Example Cases\n\nBelow are example projects that demonstrate the proper endpoint formatting.\n\n### 8.1. BBS (Bulletin Board System)\n\n```json\n{\"endpoints\":[{\"path\":\"/bbs/articles\",\"method\":\"post\"},{\"path\":\"/bbs/articles\",\"method\":\"patch\"},{\"path\":\"/bbs/articles/abridges\",\"method\":\"patch\"},{\"path\":\"/bbs/articles/{id}\",\"method\":\"get\"},{\"path\":\"/bbs/articles/{id}\",\"method\":\"put\"},{\"path\":\"/bbs/articles/{id}\",\"method\":\"delete\"},{\"path\":\"/bbs/articles/{articleId}/comments\",\"method\":\"post\"},{\"path\":\"/bbs/articles/{articleId}/comments\",\"method\":\"patch\"},{\"path\":\"/bbs/articles/{articleId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/bbs/articles/{articleId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/bbs/articles/{articleId}/comments/{id}\",\"method\":\"delete\"},{\"path\":\"/monitors/health\",\"method\":\"get\"},{\"path\":\"/monitors/performance\",\"method\":\"get\"},{\"path\":\"/monitors/system\",\"method\":\"get\"}]}\n```\n\n**Key points**: Notice how the domain prefix \"bbs\" is separated with a slash, entities use camelCase, and hierarchical relationships are expressed (e.g., `/bbs/articles/{articleId}/comments`).\n\n### 8.2. Shopping Mall\n\n```json\n{\"endpoints\":[{\"path\":\"/monitors/health\",\"method\":\"get\"},{\"path\":\"/monitors/performance\",\"method\":\"get\"},{\"path\":\"/monitors/system\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/authenticate\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/authenticate\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/authenticate/login\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/coupons\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/coupons\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/coupons/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/coupons/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/deposits\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/deposits\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/deposits/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/deposits/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/deposits/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/mileages\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/mileages\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/mileages/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/mileages/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/mileages/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/mileages/donations\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/mileages/donations\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/mileages/donations/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/orders\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/orders/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/details\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/questions/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/reviews/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/snapshots\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/sales/{saleId}/snapshots/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/sales/{saleId}/snapshots/{id}/flip\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories/merge\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/systematic/channels/{channelCode}/categories/{id}/invert\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/channels\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/systematic/channels\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/systematic/channels/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/channels/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/systematic/channels/merge\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/systematic/channels/hierarchical\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/systematic/channels/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/sections\",\"method\":\"post\"},{\"path\":\"/shoppings/admins/systematic/sections\",\"method\":\"patch\"},{\"path\":\"/shoppings/admins/systematic/sections/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/admins/systematic/sections/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/admins/systematic/sections/merge\",\"method\":\"delete\"},{\"path\":\"/shoppings/admins/systematic/sections/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/authenticate/refresh\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/authenticate\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/authenticate\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/authenticate/join\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/authenticate/login\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/authenticate/activate\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/authenticate/external\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/authenticate/password/change\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/coupons\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/coupons/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/coupons/tickets\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/coupons/tickets\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/coupons/tickets/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/deposits/charges\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/deposits/charges\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/deposits/charges/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/deposits/charges/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/deposits/charges/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/customers/deposits/charges/{chargeId}/publish/able\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/deposits/charges/{chargeId}/publish\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/deposits/histories\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/deposits/histories/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/deposits/histories/balance\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/mileages/histories\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/mileages/histories/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/mileages/histories/balance\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/carts/commodities\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/carts/commodities\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/carts/commodities/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/carts/commodities/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/carts/commodities/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/customers/carts/commodities/{id}/replica\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/carts/commodities/discountable\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/orders\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/orders\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/orders/direct\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/orders/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/orders/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/customers/orders/{id}/price\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/orders/{id}/discountable\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/orders/{id}/discount\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/orders/{orderId}/goods/{id}/confirm\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/orders/{orderId}/publish/able\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/orders/{orderId}/publish\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/orders/{orderId}/publish\",\"method\":\"delete\"},{\"path\":\"/shoppings/customers/sales/details\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/{id}\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/questions/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/{id}\",\"method\":\"post\"},{\"path\":\"/shoppings/customers/sales/{saleId}/reviews/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/snapshots\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/sales/{saleId}/snapshots/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/sales/{saleId}/snapshots/{id}/flip\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/channels/{channelCode}/categories\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/systematic/channels/{channelCode}/categories/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/channels/{channelCode}/categories/{id}/invert\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/channels\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/systematic/channels/hierarchical\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/systematic/channels/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/channels/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/sections\",\"method\":\"patch\"},{\"path\":\"/shoppings/customers/systematic/sections/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/customers/systematic/sections/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/authenticate\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/authenticate\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/authenticate/login\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/deliveries\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/deliveries\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/deliveries/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/deliveries/incompletes\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/deliveries/{deliveryId}/journeys\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/deliveries/{deliveryId}/journeys/{id}/complete\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/deliveries/{deliveryId}/journeys/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/sellers/deliveries/{deliveryId}/shippers\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/coupons\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/coupons\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/coupons/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/coupons/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/sellers/orders\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/orders/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{id}/open\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{id}/replica\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{id}/pause\",\"method\":\"delete\"},{\"path\":\"/shoppings/sellers/sales/{id}/suspend\",\"method\":\"delete\"},{\"path\":\"/shoppings/sellers/sales/{id}/restore\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/details\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{questionId}/answer\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{questionId}/answer\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/questions/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{reviewId}/answer\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{reviewId}/answer\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{inquiryId}/comments\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{inquiryId}/comments/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/abridges\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/reviews/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/snapshots/{id}/replica\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/snapshots\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/snapshots/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/snapshots/{id}/flip\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/units/{unitId}/stocks/{stockId}/supplements\",\"method\":\"post\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/units/{unitId}/stocks/{stockId}/supplements\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/units/{unitId}/stocks/{stockId}/supplements/{id}\",\"method\":\"put\"},{\"path\":\"/shoppings/sellers/sales/{saleId}/units/{unitId}/stocks/{stockId}/supplements/{id}\",\"method\":\"delete\"},{\"path\":\"/shoppings/sellers/systematic/channels/{channelCode}/categories\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/systematic/channels/{channelCode}/categories/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/systematic/channels/{channelCode}/categories/{id}/invert\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/systematic/channels\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/systematic/channels/hierarchical\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/systematic/channels/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/systematic/channels/{code}/get\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/systematic/sections\",\"method\":\"patch\"},{\"path\":\"/shoppings/sellers/systematic/sections/{id}\",\"method\":\"get\"},{\"path\":\"/shoppings/sellers/systematic/sections/{code}/get\",\"method\":\"get\"}]}\n```\n\n**Key points**: Observe how `/shopping` is used as domain prefix, hierarchical relationships are reflected in paths (e.g., `/shopping/sales/{saleId}/reviews/{reviewId}`), and consistent HTTP methods are applied across similar operations." /* AutoBeSystemPromptConstant.INTERFACE_ENDPOINT */),
37
- tokenUsage: ctx.usage(),
38
- controllers: [
39
- createApplication({
40
- model: ctx.model,
41
- build: (endpoints) => __awaiter(this, void 0, void 0, function* () {
42
- pointer.value = endpoints;
43
- }),
44
- }),
45
- ],
46
- });
47
- const histories = yield agentica.conversate(content);
48
- if (((_b = histories.at(-1)) === null || _b === void 0 ? void 0 : _b.type) === "assistantMessage")
49
- return Object.assign(Object.assign({}, histories.at(-1)), { created_at: start.toISOString(), completed_at: new Date().toISOString(), id: (0, uuid_1.v4)() });
50
- else if (pointer.value === null)
51
- throw new Error("Failed to generate endpoints."); // unreachable
52
- return {
53
- type: "interfaceEndpoints",
54
- endpoints: new tstl_1.HashSet(pointer.value, OpenApiEndpointComparator_1.OpenApiEndpointComparator.hashCode, OpenApiEndpointComparator_1.OpenApiEndpointComparator.equals).toJSON(),
55
- created_at: start.toISOString(),
56
- step: (_d = (_c = ctx.state().analyze) === null || _c === void 0 ? void 0 : _c.step) !== null && _d !== void 0 ? _d : 0,
57
- };
58
- });
59
- }
60
- function createApplication(props) {
61
- (0, assertSchemaModel_1.assertSchemaModel)(props.model);
62
- const application = collection[props.model];
63
- return {
64
- protocol: "class",
65
- name: "interface",
66
- application,
67
- execute: {
68
- makeEndpoints: (next) => __awaiter(this, void 0, void 0, function* () {
69
- yield props.build(next.endpoints);
70
- return {
71
- success: true,
72
- };
73
- }),
74
- },
75
- };
76
- }
77
- const claude = typia_1.default.llm.application();
78
- const collection = {
79
- chatgpt: typia_1.default.llm.application(),
80
- claude,
81
- llama: claude,
82
- deepseek: claude,
83
- "3.1": claude,
84
- "3.0": typia_1.default.llm.application(),
85
- };
86
- //# sourceMappingURL=orchestrateInterfaceEndpoints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestrateInterfaceEndpoints.js","sourceRoot":"","sources":["../../../../../../agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAsBA,sEAuDC;AA7ED,yCAKwB;AAOxB,+BAAyC;AACzC,kDAA0B;AAC1B,+BAA0B;AAI1B,uEAAoE;AACpE,2EAAwE;AACxE,+EAA4E;AAE5E,SAAsB,6BAA6B;yDAGjD,GAAyB,EACzB,UAAkB,0CAA0C;;QAE5D,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,OAAO,GAA+C;YAC1D,KAAK,EAAE,IAAI;SACZ,CAAC;QACF,MAAM,QAAQ,GAAyB,IAAI,oBAAa,CAAC;YACvD,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,MAAM,kCACD,CAAC,MAAA,GAAG,CAAC,MAAM,mCAAI,EAAE,CAAC,KACrB,QAAQ,EAAE;oBACR,QAAQ,EAAE,IAAI;iBACf,GACF;YACD,SAAS,EAAE,IAAA,yDAA2B,EACpC,GAAG,CAAC,KAAK,EAAE,s4tBAEZ;YACD,UAAU,EAAE,GAAG,CAAC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,OAAO;QACjB,IAAI,EAAE,WAAW;QACjB,WAAW;QACX,OAAO,EAAE;YACP,aAAa,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC5B,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBAClC,OAAO;oBACL,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC,CAAA;SACqB;KACzB,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,eAAK,CAAC,GAAG,CAAC,WAAW,EAIjC,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,eAAK,CAAC,GAAG,CAAC,WAAW,EAI3B;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,eAAK,CAAC,GAAG,CAAC,WAAW,EAAuB;CACpD,CAAC"}
@@ -1,4 +0,0 @@
1
- import { AutoBeOpenApi } from "@autobe/interface";
2
- import { ILlmSchema } from "@samchon/openapi";
3
- import { AutoBeContext } from "../../context/AutoBeContext";
4
- export declare function orchestrateInterfaceOperations<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, endpoints: AutoBeOpenApi.IEndpoint[], capacity?: number): Promise<AutoBeOpenApi.IOperation[]>;