agentica 0.12.8 → 0.12.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 (53) hide show
  1. package/bin/index.js +139 -41
  2. package/package.json +15 -12
  3. package/bin/bases/Connector.d.ts +0 -9
  4. package/bin/bases/Connector.js +0 -67
  5. package/bin/bases/Connector.js.map +0 -1
  6. package/bin/bases/Package.d.ts +0 -11
  7. package/bin/bases/Package.js +0 -74
  8. package/bin/bases/Package.js.map +0 -1
  9. package/bin/bases/Tsconfig.d.ts +0 -5
  10. package/bin/bases/Tsconfig.js +0 -135
  11. package/bin/bases/Tsconfig.js.map +0 -1
  12. package/bin/executable/AgenticaStart.d.ts +0 -7
  13. package/bin/executable/AgenticaStart.js +0 -325
  14. package/bin/executable/AgenticaStart.js.map +0 -1
  15. package/bin/index.d.ts +0 -2
  16. package/bin/index.js.map +0 -1
  17. package/bin/structures/IAgenticaStart.d.ts +0 -31
  18. package/bin/structures/IAgenticaStart.js +0 -3
  19. package/bin/structures/IAgenticaStart.js.map +0 -1
  20. package/bin/structures/IAgenticaStartOption.d.ts +0 -13
  21. package/bin/structures/IAgenticaStartOption.js +0 -3
  22. package/bin/structures/IAgenticaStartOption.js.map +0 -1
  23. package/bin/utils/capitalize.d.ts +0 -1
  24. package/bin/utils/capitalize.js +0 -12
  25. package/bin/utils/capitalize.js.map +0 -1
  26. package/bin/utils/createProjectDirectory.d.ts +0 -3
  27. package/bin/utils/createProjectDirectory.js +0 -16
  28. package/bin/utils/createProjectDirectory.js.map +0 -1
  29. package/bin/utils/getNpmPackages.d.ts +0 -14
  30. package/bin/utils/getNpmPackages.js +0 -147
  31. package/bin/utils/getNpmPackages.js.map +0 -1
  32. package/bin/utils/getQuestions.d.ts +0 -8
  33. package/bin/utils/getQuestions.js +0 -45
  34. package/bin/utils/getQuestions.js.map +0 -1
  35. package/bin/utils/types/PackageManager.d.ts +0 -1
  36. package/bin/utils/types/PackageManager.js +0 -3
  37. package/bin/utils/types/PackageManager.js.map +0 -1
  38. package/bin/utils/types/ProjectOption.d.ts +0 -4
  39. package/bin/utils/types/ProjectOption.js +0 -3
  40. package/bin/utils/types/ProjectOption.js.map +0 -1
  41. package/src/bases/Connector.ts +0 -80
  42. package/src/bases/Package.ts +0 -75
  43. package/src/bases/Tsconfig.ts +0 -122
  44. package/src/executable/AgenticaStart.ts +0 -305
  45. package/src/index.ts +0 -39
  46. package/src/structures/IAgenticaStart.ts +0 -35
  47. package/src/structures/IAgenticaStartOption.ts +0 -13
  48. package/src/utils/capitalize.ts +0 -7
  49. package/src/utils/createProjectDirectory.ts +0 -14
  50. package/src/utils/getNpmPackages.ts +0 -46
  51. package/src/utils/getQuestions.ts +0 -48
  52. package/src/utils/types/PackageManager.ts +0 -1
  53. package/src/utils/types/ProjectOption.ts +0 -4
package/src/index.ts DELETED
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env node
2
- import chalk from "chalk";
3
- import { Command } from "commander";
4
-
5
- import { AgenticaStart } from "./executable/AgenticaStart";
6
- import { IAgenticaStart } from "./structures/IAgenticaStart";
7
-
8
- async function main() {
9
- const program = new Command();
10
-
11
- program
12
- .command("start <directory>")
13
- .description("Start a new project")
14
- .option(
15
- "-p, --project [nodejs|nestjs|react|standalone]",
16
- "The project type",
17
- )
18
- .action(async (directory: string, options: IAgenticaStart.IOptions) => {
19
- if ((options.project as any) === true) {
20
- console.error(
21
- `\nāŒ The value of ${chalk.redBright("--project")} is required`,
22
- );
23
- return;
24
- }
25
-
26
- AgenticaStart.execute({ projectName: directory, options });
27
- });
28
-
29
- console.log("--------------------------------");
30
- console.log(` šŸš€ ${"Agentica"} ${chalk.blueBright("Setup Wizard")}`);
31
- console.log("--------------------------------");
32
-
33
- program.parse(process.argv);
34
- }
35
-
36
- main().catch((exp) => {
37
- console.error(exp.message);
38
- process.exit(-1);
39
- });
@@ -1,35 +0,0 @@
1
- import { ProjectOptionValue } from "../utils/types/ProjectOption";
2
-
3
- /**
4
- * Types about `npx agentica start` command.
5
- *
6
- * @author Michael
7
- */
8
- export namespace IAgenticaStart {
9
- /**
10
- * Options for `npx agentica start` command.
11
- */
12
- export type IOptions = Partial<{
13
- project: ProjectOptionValue;
14
- }>;
15
-
16
- /**
17
- * Parameters for execute `npx agentica start` command.
18
- */
19
- export interface IExecuteInput {
20
- projectName: string;
21
- options: IOptions;
22
- }
23
-
24
- /**
25
- * Input for `getQuestions` function.
26
- */
27
- export interface IGetQuestionsInput {
28
- services: {
29
- name: string;
30
- value: string;
31
- }[];
32
-
33
- options: IOptions;
34
- }
35
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Types about options for `npx agentica start` command.
3
- *
4
- * @author Michael
5
- */
6
- export namespace IAgenticaStartOption {
7
- export interface IProject {
8
- projectName: string;
9
- projectPath: string;
10
- openAIKey: string;
11
- services: string[];
12
- }
13
- }
@@ -1,7 +0,0 @@
1
- // Convert first letter to uppercase (ex: aws-s3 -> AwsS3)
2
- export const capitalize = (service: string): string => {
3
- return service
4
- .split("-")
5
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
6
- .join("");
7
- };
@@ -1,14 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
-
4
- export const createProjectDirectory = (input: {
5
- projectPath: string;
6
- }): void => {
7
- if (fs.existsSync(input.projectPath)) {
8
- throw new Error(
9
- `${path.basename(input.projectPath)} directory already exists.`,
10
- );
11
- }
12
-
13
- fs.mkdirSync(input.projectPath);
14
- };
@@ -1,46 +0,0 @@
1
- import typia, { tags } from "typia";
2
-
3
- export interface INpmPackages {
4
- objects: {
5
- package: {
6
- name: string;
7
- };
8
- }[];
9
- total: number;
10
- time: string & tags.Format<"date-time">;
11
- }
12
-
13
- export const getNpmPackages = async (): Promise<
14
- { name: string; value: string }[]
15
- > => {
16
- try {
17
- const response = await fetch(
18
- "https://registry.npmjs.org/-/v1/search?text=scope:@wrtnlabs&size=10000",
19
- );
20
- const responseJson = (await response.json()) as INpmPackages;
21
-
22
- const data = typia.assert<INpmPackages>(responseJson);
23
-
24
- return data.objects
25
- .map((pkg) => pkg.package.name)
26
- .filter((name: string) => {
27
- // shared is not connector package. This is connector util package.
28
- if (name === "@wrtnlabs/connector-shared") {
29
- return false;
30
- }
31
-
32
- const regex = /^@wrtnlabs\/connector-(?:[a-z0-9-]+)+$/;
33
- return regex.test(name);
34
- })
35
- .map((name: string) => {
36
- const serviceName = name.replace("@wrtnlabs/connector-", "");
37
- return {
38
- name: serviceName.replace("-", " ").toUpperCase(),
39
- value: serviceName,
40
- };
41
- });
42
- } catch (error) {
43
- console.error("Error occurred while fetching package list:", error);
44
- return [];
45
- }
46
- };
@@ -1,48 +0,0 @@
1
- import chalk from "chalk";
2
- import { QuestionCollection } from "inquirer";
3
-
4
- export interface GetQuestionsInput {
5
- services: {
6
- name: string;
7
- value: string;
8
- }[];
9
- }
10
-
11
- export const getQuestions = (
12
- input: GetQuestionsInput,
13
- ): QuestionCollection[] => {
14
- return [
15
- {
16
- type: "list",
17
- name: "packageManager",
18
- message: "Package Manager",
19
- choices: [
20
- "npm",
21
- "pnpm",
22
- `yarn (berry ${chalk.blueBright("is not supported")})`,
23
- ],
24
- },
25
- {
26
- type: "list",
27
- name: "projectType",
28
- message: "Project Type",
29
- choices: [
30
- `NodeJS ${chalk.blueBright("Agent Server")}`,
31
- `NestJS ${chalk.blueBright("Agent Server")}`,
32
- `React ${chalk.blueBright("Client Application")}`,
33
- `Standard ${chalk.blueBright("Application")}`,
34
- ],
35
- },
36
- {
37
- type: "checkbox",
38
- name: "services",
39
- message: "Embedded Controllers",
40
- choices: input.services,
41
- },
42
- {
43
- type: "input",
44
- name: "openAIKey",
45
- message: "Please enter your OPEN_AI_API_KEY:",
46
- },
47
- ];
48
- };
@@ -1 +0,0 @@
1
- export type PackageManager = "npm" | "yarn" | "pnpm";
@@ -1,4 +0,0 @@
1
- /**
2
- * Value of the `--project` option.
3
- */
4
- export type ProjectOptionValue = "nodejs" | "nestjs" | "react" | "standalone";