agentica 0.12.7 ā 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.
- package/bin/index.js +139 -41
- package/package.json +15 -12
- package/bin/bases/Connector.d.ts +0 -9
- package/bin/bases/Connector.js +0 -67
- package/bin/bases/Connector.js.map +0 -1
- package/bin/bases/Package.d.ts +0 -11
- package/bin/bases/Package.js +0 -74
- package/bin/bases/Package.js.map +0 -1
- package/bin/bases/Tsconfig.d.ts +0 -5
- package/bin/bases/Tsconfig.js +0 -135
- package/bin/bases/Tsconfig.js.map +0 -1
- package/bin/executable/AgenticaStart.d.ts +0 -7
- package/bin/executable/AgenticaStart.js +0 -324
- package/bin/executable/AgenticaStart.js.map +0 -1
- package/bin/index.d.ts +0 -2
- package/bin/index.js.map +0 -1
- package/bin/structures/IAgenticaStart.d.ts +0 -31
- package/bin/structures/IAgenticaStart.js +0 -3
- package/bin/structures/IAgenticaStart.js.map +0 -1
- package/bin/structures/IAgenticaStartOption.d.ts +0 -13
- package/bin/structures/IAgenticaStartOption.js +0 -3
- package/bin/structures/IAgenticaStartOption.js.map +0 -1
- package/bin/utils/capitalize.d.ts +0 -1
- package/bin/utils/capitalize.js +0 -12
- package/bin/utils/capitalize.js.map +0 -1
- package/bin/utils/createProjectDirectory.d.ts +0 -3
- package/bin/utils/createProjectDirectory.js +0 -16
- package/bin/utils/createProjectDirectory.js.map +0 -1
- package/bin/utils/getNpmPackages.d.ts +0 -14
- package/bin/utils/getNpmPackages.js +0 -147
- package/bin/utils/getNpmPackages.js.map +0 -1
- package/bin/utils/getQuestions.d.ts +0 -8
- package/bin/utils/getQuestions.js +0 -45
- package/bin/utils/getQuestions.js.map +0 -1
- package/bin/utils/types/PackageManager.d.ts +0 -1
- package/bin/utils/types/PackageManager.js +0 -3
- package/bin/utils/types/PackageManager.js.map +0 -1
- package/bin/utils/types/ProjectOption.d.ts +0 -4
- package/bin/utils/types/ProjectOption.js +0 -3
- package/bin/utils/types/ProjectOption.js.map +0 -1
- package/src/bases/Connector.ts +0 -80
- package/src/bases/Package.ts +0 -75
- package/src/bases/Tsconfig.ts +0 -122
- package/src/executable/AgenticaStart.ts +0 -302
- package/src/index.ts +0 -39
- package/src/structures/IAgenticaStart.ts +0 -35
- package/src/structures/IAgenticaStartOption.ts +0 -13
- package/src/utils/capitalize.ts +0 -7
- package/src/utils/createProjectDirectory.ts +0 -14
- package/src/utils/getNpmPackages.ts +0 -46
- package/src/utils/getQuestions.ts +0 -48
- package/src/utils/types/PackageManager.ts +0 -1
- 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
|
-
}
|
package/src/utils/capitalize.ts
DELETED
|
@@ -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";
|