agentica 0.1.0
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/README.md +67 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +62 -0
- package/bin/index.js.map +1 -0
- package/package.json +54 -0
- package/src/index.ts +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Agentica CLI Tool
|
|
2
|
+
```bash
|
|
3
|
+
npx agentica start <directory>
|
|
4
|
+
npx agentica backend <directory>
|
|
5
|
+
npx agentica client <directory>
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
[](https://github.com/wrtnlabs/agentica/blob/master/LICENSE)
|
|
9
|
+
[](https://www.npmjs.com/package/agentica)
|
|
10
|
+
[](https://www.npmjs.com/package/agentica)
|
|
11
|
+
[](https://github.com/wrtnlabs/agentica/actions?query=workflow%3Abuild)
|
|
12
|
+
|
|
13
|
+
Agentica CLI Tool cloning boilerplate project.
|
|
14
|
+
|
|
15
|
+
- `start`: a frontend application creating agent in browser
|
|
16
|
+
- `backend`: backend application serving the agent through websocket protocol
|
|
17
|
+
- `client`: frontend application connecting to above websocket server
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Introduction
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { Agentica } from "@agentica/core";
|
|
27
|
+
import typia from "typia";
|
|
28
|
+
|
|
29
|
+
const agent = new Agentica({
|
|
30
|
+
controllers: [
|
|
31
|
+
await fetch(
|
|
32
|
+
"https://shopping-be.wrtn.ai/editor/swagger.json",
|
|
33
|
+
).then(r => r.json()),
|
|
34
|
+
typia.llm.application<ShoppingCounselor>(),
|
|
35
|
+
typia.llm.application<ShoppingPolicy>(),
|
|
36
|
+
typia.llm.application<ShoppingSearchRag>(),
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
await agent.conversate("I wanna buy MacBook Pro");
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The simplest **Agentic AI** library, specialized in **LLM Function Calling**.
|
|
43
|
+
|
|
44
|
+
Don't compose complicate agent graph or workflow, but just deliver **Swagger/OpenAPI** documents or **TypeScript class** types linearly to the `@agentica`. Then `@agentica` will do everything with the function calling.
|
|
45
|
+
|
|
46
|
+
Look at the below demonstration, and feel how `@agentica` is easy and powerful.
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { Agentica } from "@agentica/core";
|
|
50
|
+
import typia from "typia";
|
|
51
|
+
|
|
52
|
+
const agent = new Agentica({
|
|
53
|
+
controllers: [
|
|
54
|
+
await fetch(
|
|
55
|
+
"https://shopping-be.wrtn.ai/editor/swagger.json",
|
|
56
|
+
).then(r => r.json()),
|
|
57
|
+
typia.llm.application<ShoppingCounselor>(),
|
|
58
|
+
typia.llm.application<ShoppingPolicy>(),
|
|
59
|
+
typia.llm.application<ShoppingSearchRag>(),
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
await agent.conversate("I wanna buy MacBook Pro");
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> https://github.com/user-attachments/assets/01604b53-aca4-41cb-91aa-3faf63549ea6
|
|
66
|
+
>
|
|
67
|
+
> Demonstration video of Shopping AI Chatbot
|
package/bin/index.d.ts
ADDED
package/bin/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
const child_process_1 = __importDefault(require("child_process"));
|
|
17
|
+
const fs_1 = __importDefault(require("fs"));
|
|
18
|
+
const USAGE = `Wrong command has been detected. Use like below:
|
|
19
|
+
|
|
20
|
+
npx agentica <type> <directory>
|
|
21
|
+
|
|
22
|
+
1. npx agentica start <directory>
|
|
23
|
+
2. npx agentica backend <directory>
|
|
24
|
+
3. npx agentica client <directory>
|
|
25
|
+
`;
|
|
26
|
+
const halt = (desc) => {
|
|
27
|
+
console.error(desc);
|
|
28
|
+
process.exit(-1);
|
|
29
|
+
};
|
|
30
|
+
const clone = (type, directory) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
const execute = (command) => {
|
|
32
|
+
console.log(`\n$ ${command}`);
|
|
33
|
+
child_process_1.default.execSync(command, { stdio: "inherit" });
|
|
34
|
+
};
|
|
35
|
+
// COPY PROJECTS
|
|
36
|
+
execute(`git clone https://github.com/wrtnlabs/agentica-template-${type} ${directory}`);
|
|
37
|
+
console.log(`cd "${directory}"`);
|
|
38
|
+
process.chdir(directory);
|
|
39
|
+
// INSTALL DEPENDENCIES
|
|
40
|
+
execute("npm install");
|
|
41
|
+
// BUILD TYPESCRIPT
|
|
42
|
+
execute("npm run build");
|
|
43
|
+
// DO TEST
|
|
44
|
+
execute("npm run test");
|
|
45
|
+
// REMOVE .GIT DIRECTORY
|
|
46
|
+
child_process_1.default.execSync("npx rimraf .git");
|
|
47
|
+
child_process_1.default.execSync("npx rimraf .github/dependabot.yml");
|
|
48
|
+
});
|
|
49
|
+
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
50
|
+
const [_v0, _v1, type, directory] = process.argv;
|
|
51
|
+
if (["start", "backend", "client", "standalone"].includes(type) === false ||
|
|
52
|
+
directory === undefined)
|
|
53
|
+
halt(USAGE);
|
|
54
|
+
else if (fs_1.default.existsSync(directory) === true)
|
|
55
|
+
halt("The target directory already exists.");
|
|
56
|
+
yield clone(type, directory);
|
|
57
|
+
});
|
|
58
|
+
main().catch((exp) => {
|
|
59
|
+
console.log(exp.message);
|
|
60
|
+
process.exit(-1);
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
package/bin/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kEAA+B;AAC/B,4CAAoB;AAEpB,MAAM,KAAK,GAAG;;;;;;;CAOb,CAAC;AAEF,MAAM,IAAI,GAAG,CAAC,IAAY,EAAS,EAAE;IACnC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,CAAO,IAAY,EAAE,SAAiB,EAAiB,EAAE;IACrE,MAAM,OAAO,GAAG,CAAC,OAAe,EAAQ,EAAE;QACxC,OAAO,CAAC,GAAG,CAAC,OAAO,OAAO,EAAE,CAAC,CAAC;QAC9B,uBAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC;IAEF,gBAAgB;IAChB,OAAO,CACL,2DAA2D,IAAI,IAAI,SAAS,EAAE,CAC/E,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,OAAO,SAAS,GAAG,CAAC,CAAC;IACjC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEzB,uBAAuB;IACvB,OAAO,CAAC,aAAa,CAAC,CAAC;IAEvB,mBAAmB;IACnB,OAAO,CAAC,eAAe,CAAC,CAAC;IAEzB,UAAU;IACV,OAAO,CAAC,cAAc,CAAC,CAAC;IAExB,wBAAwB;IACxB,uBAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC/B,uBAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAC;AACnD,CAAC,CAAA,CAAC;AAEF,MAAM,IAAI,GAAG,GAAwB,EAAE;IACrC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IACjD,IACE,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK;QACrE,SAAS,KAAK,SAAS;QAEvB,IAAI,CAAC,KAAK,CAAC,CAAC;SACT,IAAI,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,IAAI;QACxC,IAAI,CAAC,sCAAsC,CAAC,CAAC;IAC/C,MAAM,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC/B,CAAC,CAAA,CAAC;AACF,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agentica",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"main": "bin/index.js",
|
|
5
|
+
"typings": "bin/index.d.ts",
|
|
6
|
+
"description": "Agentic AI Library specialized in LLM Function Calling",
|
|
7
|
+
"bin": {
|
|
8
|
+
"nestia": "bin/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "rimraf bin && tsc",
|
|
12
|
+
"dev": "rimraf bin && tsc --watch"
|
|
13
|
+
},
|
|
14
|
+
"author": "Wrtn Technologies",
|
|
15
|
+
"homepage": "https://wrtnlabs.io/agentica",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/wrtnlabs/agentica"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/wrtnlabs/agentica/issues"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"openai",
|
|
26
|
+
"chatgpt",
|
|
27
|
+
"anthropic",
|
|
28
|
+
"claude",
|
|
29
|
+
"ai",
|
|
30
|
+
"chatbot",
|
|
31
|
+
"nestia",
|
|
32
|
+
"swagger",
|
|
33
|
+
"openapi"
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"package.json",
|
|
39
|
+
"bin",
|
|
40
|
+
"src"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"commander": "^10.0.0",
|
|
44
|
+
"comment-json": "^4.2.3",
|
|
45
|
+
"inquirer": "^8.2.5",
|
|
46
|
+
"package-manager-detector": "^0.2.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/inquirer": "^9.0.3",
|
|
50
|
+
"@types/node": "^18.19.76",
|
|
51
|
+
"rimraf": "^6.0.1",
|
|
52
|
+
"typescript": "~5.8.2"
|
|
53
|
+
}
|
|
54
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import cp from "child_process";
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
|
|
5
|
+
const USAGE = `Wrong command has been detected. Use like below:
|
|
6
|
+
|
|
7
|
+
npx agentica <type> <directory>
|
|
8
|
+
|
|
9
|
+
1. npx agentica start <directory>
|
|
10
|
+
2. npx agentica backend <directory>
|
|
11
|
+
3. npx agentica client <directory>
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
const halt = (desc: string): never => {
|
|
15
|
+
console.error(desc);
|
|
16
|
+
process.exit(-1);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const clone = async (type: string, directory: string): Promise<void> => {
|
|
20
|
+
const execute = (command: string): void => {
|
|
21
|
+
console.log(`\n$ ${command}`);
|
|
22
|
+
cp.execSync(command, { stdio: "inherit" });
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// COPY PROJECTS
|
|
26
|
+
execute(
|
|
27
|
+
`git clone https://github.com/wrtnlabs/agentica-template-${type} ${directory}`,
|
|
28
|
+
);
|
|
29
|
+
console.log(`cd "${directory}"`);
|
|
30
|
+
process.chdir(directory);
|
|
31
|
+
|
|
32
|
+
// INSTALL DEPENDENCIES
|
|
33
|
+
execute("npm install");
|
|
34
|
+
|
|
35
|
+
// BUILD TYPESCRIPT
|
|
36
|
+
execute("npm run build");
|
|
37
|
+
|
|
38
|
+
// DO TEST
|
|
39
|
+
execute("npm run test");
|
|
40
|
+
|
|
41
|
+
// REMOVE .GIT DIRECTORY
|
|
42
|
+
cp.execSync("npx rimraf .git");
|
|
43
|
+
cp.execSync("npx rimraf .github/dependabot.yml");
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const main = async (): Promise<void> => {
|
|
47
|
+
const [_v0, _v1, type, directory] = process.argv;
|
|
48
|
+
if (
|
|
49
|
+
["start", "backend", "client", "standalone"].includes(type) === false ||
|
|
50
|
+
directory === undefined
|
|
51
|
+
)
|
|
52
|
+
halt(USAGE);
|
|
53
|
+
else if (fs.existsSync(directory) === true)
|
|
54
|
+
halt("The target directory already exists.");
|
|
55
|
+
await clone(type, directory);
|
|
56
|
+
};
|
|
57
|
+
main().catch((exp) => {
|
|
58
|
+
console.log(exp.message);
|
|
59
|
+
process.exit(-1);
|
|
60
|
+
});
|