feat: WIP refactor monorepo to packages and turbo

old-agentic-v1^2
Travis Fischer 2023-06-28 22:32:51 -07:00
rodzic ceff46ac52
commit 27f0ae4d05
87 zmienionych plików z 3478 dodań i 346 usunięć

Wyświetl plik

@ -13,7 +13,7 @@
},
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
"project": "./packages/core/tsconfig.json"
},
"rules": {
"@typescript-eslint/no-unused-vars": [
@ -57,7 +57,7 @@
},
{
// disable process.env for framework source files
"files": "src/**/*.ts",
"files": "packages/**/src/*.ts",
"rules": {
"no-process-env": "error"
}

2
legacy/.gitignore vendored
Wyświetl plik

@ -51,3 +51,5 @@ next-env.d.ts
.env.development.local
.env.test.local
.env.production.local
.turbo

Wyświetl plik

@ -1,8 +1,6 @@
{
"name": "agentic-docs",
"version": "0.0.0",
"private": true,
"description": "agentic docs website.",
"description": "Agentic docs website",
"repository": "transitive-bullshit/agentic",
"homepage": "https://agentic.so/docs",
"license": "MIT",
@ -17,9 +15,5 @@
"nextra-theme-docs": "^2.8.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^20.3.1",
"typescript": "^5.1.3"
}
}

Wyświetl plik

@ -1,2 +1 @@
# agentic

Wyświetl plik

@ -20,7 +20,7 @@ Otherwise, you can pass it in as an argument to the `BingWebSearchClient` constr
![](https://ajeuwbhvhr.cloudimg.io/colony-recorder.s3.amazonaws.com/files/2023-06-14/fb65476e-3619-41df-bea2-44a438f9772e/ascreenshot.jpeg?tl_px=290,424&br_px=1410,1054&force_format=png&width=560&wat_scale=50&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=262,139)
4. Under the "Select a pricing tier" dropdown, select __F1 (3 Calls per second, 1k Calls per month)__ for the free tier. See [Bing Web Search pricing][bing-web-search-pricing] for more information about the available pricing tiers.
3. Under the "Select a pricing tier" dropdown, select **F1 (3 Calls per second, 1k Calls per month)** for the free tier. See [Bing Web Search pricing][bing-web-search-pricing] for more information about the available pricing tiers.
![](https://ajeuwbhvhr.cloudimg.io/colony-recorder.s3.amazonaws.com/files/2023-06-14/5fa212c2-574e-4800-b245-96b121a4f47c/ascreenshot.jpeg?tl_px=655,576&br_px=1775,1206&force_format=png&width=560&wat_scale=50&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=262,139)
@ -28,14 +28,13 @@ Otherwise, you can pass it in as an argument to the `BingWebSearchClient` constr
![](https://ajeuwbhvhr.cloudimg.io/colony-recorder.s3.amazonaws.com/files/2023-06-14/c52f825b-f591-4ab7-8a91-3490f6bde4c4/ascreenshot.jpeg?tl_px=0,750&br_px=1120,1380&force_format=png&width=560&wat_scale=50&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=249,276)
2. Once the resource has been deployed, navigate to it and click on the "Keys and Endpoint" link in the left sidebar:
5. Once the resource has been deployed, navigate to it and click on the "Keys and Endpoint" link in the left sidebar:
![](https://ajeuwbhvhr.cloudimg.io/colony-recorder.s3.amazonaws.com/files/2023-06-14/b37dbdd2-553e-4736-b341-3e540d492eb2/user_cropped_screenshot.jpeg?tl_px=0,318&br_px=1120,948&force_format=png&width=560&wat_scale=50&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=228,139)
3. Click the "Copy to clipboard" button next to the "Key 1" value to copy the API key to your clipboard (or click "Show" to reveal the key and copy it manually). The other key is a backup key that can be used if the first key is revoked or regenerated.
6. Click the "Copy to clipboard" button next to the "Key 1" value to copy the API key to your clipboard (or click "Show" to reveal the key and copy it manually). The other key is a backup key that can be used if the first key is revoked or regenerated.
![](https://ajeuwbhvhr.cloudimg.io/colony-recorder.s3.amazonaws.com/files/2023-06-14/993cb2f5-b632-46d4-b81a-43860575794a/user_cropped_screenshot.jpeg?tl_px=792,125&br_px=1912,755&force_format=png&width=560&wat_scale=50&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=521,139)
[bing-web-search]: https://azure.microsoft.com/en-us/services/cognitive-services/bing-web-search-api
[bing-web-search-pricing]: https://azure.microsoft.com/en-us/pricing/details/cognitive-services/search-api/web/

Wyświetl plik

@ -55,19 +55,19 @@ You may provide these alternatively when instantiating the service via the `apiK
![](https://ajeuwbhvhr.cloudimg.io/colony-recorder.s3.amazonaws.com/files/2023-06-10/fc6a2439-6961-45a2-8059-3df1b923f17a/ascreenshot.jpeg?tl_px=817,445&br_px=1937,1075&force_format=png&width=560&wat_scale=50&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=262,139)
7. Review the OAuth scopes and enabled features and proceed by clicking "Create"
6. Review the OAuth scopes and enabled features and proceed by clicking "Create"
![](https://ajeuwbhvhr.cloudimg.io/colony-recorder.s3.amazonaws.com/files/2023-06-10/94d883e4-9059-423a-88ad-a447353edd76/ascreenshot.jpeg?tl_px=922,531&br_px=2042,1161&force_format=png&width=560&wat_scale=50&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=262,139)
8. Click "Install to Workspace" to install your application to your workspace:
7. Click "Install to Workspace" to install your application to your workspace:
![](https://ajeuwbhvhr.cloudimg.io/colony-recorder.s3.amazonaws.com/files/2023-06-10/8daf26cc-d412-4a4e-9b3e-81e38a81f5c6/ascreenshot.jpeg?tl_px=278,553&br_px=1398,1183&force_format=png&width=560&wat_scale=50&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=262,139)
9. Almost there! To obtain the API key for the Agentic Service, click "OAuth & Permissions" in the left navigation menu of the Slack Dashboard of your application and scroll down to the "OAuth Tokens for Your Workspace" section.
8. Almost there! To obtain the API key for the Agentic Service, click "OAuth & Permissions" in the left navigation menu of the Slack Dashboard of your application and scroll down to the "OAuth Tokens for Your Workspace" section.
![](https://ajeuwbhvhr.cloudimg.io/colony-recorder.s3.amazonaws.com/files/2023-06-10/c34e3efc-02cd-4aa8-a4d3-9a9fe2395118/user_cropped_screenshot.jpeg?tl_px=0,254&br_px=1120,884&force_format=png&width=560&wat_scale=50&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=66,162)
10. Click "Copy" to copy the Bot User OAuth API Key to your clipboard.
9. Click "Copy" to copy the Bot User OAuth API Key to your clipboard.
![](https://ajeuwbhvhr.cloudimg.io/colony-recorder.s3.amazonaws.com/files/2023-06-10/6ee4a836-2e62-4eb9-adbf-6d17b2fc5184/user_cropped_screenshot.jpeg?tl_px=0,0&br_px=1086,517&force_format=png&width=560&wat_scale=50&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=487,134)

Wyświetl plik

@ -1,102 +1,50 @@
{
"name": "agentic",
"private": true,
"description": "TODO",
"description": "Everything you need to build reliable AI agents with TypeScript.",
"author": "Travis Fischer <travis@transitivebullsh.it>",
"repository": "transitive-bullshit/agentic",
"license": "MIT",
"type": "module",
"source": "./src/index.ts",
"types": "./build/index.d.ts",
"exports": {
".": {
"import": "./build/index.js",
"require": "./build/index.cjs",
"types": "./build/index.d.ts",
"default": "./build/index.js"
}
},
"files": [
"build"
],
"packageManager": "pnpm@8.6.2",
"engines": {
"node": ">=14"
"node": ">=18"
},
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"clean": "del build",
"lint": "eslint \"**/*.ts\" --fix",
"prebuild": "run-s clean",
"predev": "run-s clean",
"pretest": "run-s build",
"build": "turbo build --filter=\"./packages/*\"",
"changeset": "changeset",
"clean": "turbo clean --filter=\"./packages/*\"",
"dev": "turbo dev --no-cache --continue",
"prepare": "husky install",
"pre-commit": "lint-staged",
"test": "run-s test:*",
"test:unit": "NODE_OPTIONS='--loader=tsx --no-warnings' ava",
"test:prettier": "prettier \"**/*.{js,jsx,ts,tsx}\" --check",
"test:eslint": "eslint \"**/*.ts\"",
"test-cov": "c8 ava"
},
"dependencies": {
"@agentic/midjourney-fetch": "^1.0.1",
"@anthropic-ai/sdk": "^0.4.4",
"@inquirer/checkbox": "^1.3.2",
"@inquirer/editor": "^1.2.1",
"@inquirer/input": "^1.2.2",
"@inquirer/select": "^1.2.2",
"@types/json-schema": "^7.0.12",
"colorette": "^2.0.20",
"debug": "^4.3.4",
"expr-eval": "^2.0.2",
"handlebars": "^4.7.7",
"is-relative-url": "^4.0.0",
"is-unicode-supported": "^1.3.0",
"js-tiktoken": "^1.0.7",
"jsonrepair": "^3.2.0",
"ky": "^0.33.3",
"nanoid": "^4.0.2",
"normalize-url": "^8.0.0",
"openai-fetch": "^1.6.3",
"p-map": "^6.0.0",
"p-retry": "^5.1.2",
"p-throttle": "^5.1.0",
"p-timeout": "^6.1.2",
"quick-lru": "^6.1.1",
"replicate": "^0.12.3",
"ts-dedent": "^2.2.0",
"zod": "^3.21.4",
"zod-to-json-schema": "^3.21.3",
"zod-validation-error": "^1.3.1"
"publint": "turbo publint --filter=\"packages/*\"",
"release": "turbo clean && turbo build && changeset publish",
"test": "turbo test",
"eslint-check": "eslint \"**/*.{ts,tsx}\"",
"prettier-check": "prettier --check \"**/*.{js,ts,tsx,md,mdx}\"",
"prettier-write": "prettier --write \"**/*.{js,ts,tsx,md,mdx}\"",
"version-packages": "changeset version"
},
"devDependencies": {
"@keyv/redis": "^2.6.1",
"@changesets/cli": "^2.26.2",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/debug": "^4.1.8",
"@types/node": "^20.3.2",
"@types/sinon": "^10.0.15",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"ava": "^5.3.1",
"c8": "^8.0.0",
"del-cli": "^5.0.0",
"dotenv": "^16.3.1",
"eslint": "^8.43.0",
"eslint-plugin-tsdoc": "^0.2.17",
"expect-type": "^0.16.0",
"hash-obj": "^4.0.0",
"husky": "^8.0.3",
"ioredis": "^5.3.2",
"keyv": "^4.5.2",
"lint-staged": "^13.2.3",
"npm-run-all": "^4.1.5",
"p-memoize": "^7.1.1",
"prettier": "^2.8.8",
"react": "^18.2.0",
"publint": "^0.1.12",
"sinon": "^15.2.0",
"tsup": "7.1.0",
"tsx": "^3.12.7",
"type-fest": "^3.12.0",
"turbo": "^1.10.6",
"typedoc": "^0.24.8",
"typedoc-plugin-markdown": "4.0.0-next.16",
"typescript": "^5.1.6"
@ -104,18 +52,7 @@
"lint-staged": {
"*.{ts,tsx}": [
"eslint --fix",
"prettier --write"
]
},
"ava": {
"snapshotDir": "test/.snapshots",
"failFast": true,
"extensions": {
"ts": "module"
},
"nodeArguments": [
"--loader=tsx",
"--no-warnings"
"prettier --ignore-unknown --write"
]
},
"keywords": [
@ -129,6 +66,7 @@
"llms",
"chatgpt",
"openapi",
"functions",
"guardrails",
"plugins"
]

Wyświetl plik

@ -0,0 +1,99 @@
{
"name": "@agentic/core",
"description": "Reliable building blocks for TypeScript AI agents.",
"repository": "transitive-bullshit/agentic",
"license": "MIT",
"type": "module",
"sideEffects": false,
"source": "./src/index.ts",
"types": "./build/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./build/index.js",
"require": "./build/index.cjs",
"types": "./build/index.d.ts",
"default": "./build/index.js"
}
},
"files": [
"build"
],
"engines": {
"node": ">=14"
},
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"clean": "del build",
"test": "NODE_OPTIONS='--loader=tsx --no-warnings' ava"
},
"dependencies": {
"@agentic/midjourney-fetch": "^1.0.1",
"@anthropic-ai/sdk": "^0.4.4",
"@inquirer/checkbox": "^1.3.2",
"@inquirer/editor": "^1.2.1",
"@inquirer/input": "^1.2.2",
"@inquirer/select": "^1.2.2",
"@types/json-schema": "^7.0.12",
"colorette": "^2.0.20",
"debug": "^4.3.4",
"expr-eval": "^2.0.2",
"handlebars": "^4.7.7",
"is-relative-url": "^4.0.0",
"is-unicode-supported": "^1.3.0",
"js-tiktoken": "^1.0.7",
"jsonrepair": "^3.2.0",
"ky": "^0.33.3",
"nanoid": "^4.0.2",
"normalize-url": "^8.0.0",
"openai-fetch": "^1.6.3",
"p-map": "^6.0.0",
"p-memoize": "^7.1.1",
"p-retry": "^5.1.2",
"p-throttle": "^5.1.0",
"p-timeout": "^6.1.2",
"quick-lru": "^6.1.1",
"replicate": "^0.12.3",
"ts-dedent": "^2.2.0",
"type-fest": "^3.12.0",
"zod": "^3.21.4",
"zod-to-json-schema": "^3.21.3",
"zod-validation-error": "^1.3.1"
},
"devDependencies": {
"@keyv/redis": "^2.6.1",
"@types/debug": "^4.1.8",
"@types/node": "^20.3.2",
"@types/sinon": "^10.0.15",
"expect-type": "^0.16.0",
"hash-obj": "^4.0.0",
"ioredis": "^5.3.2",
"keyv": "^4.5.2"
},
"ava": {
"snapshotDir": "test/.snapshots",
"failFast": true,
"extensions": {
"ts": "module"
},
"nodeArguments": [
"--loader=tsx",
"--no-warnings"
]
},
"keywords": [
"ai",
"openai",
"autonomous",
"agent",
"agi",
"autogpt",
"babyagi",
"llms",
"chatgpt",
"openapi",
"guardrails",
"plugins"
]
}

Wyświetl plik

@ -12,7 +12,6 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"baseUrl": ".",
"outDir": "build",
"noEmit": true,
@ -20,6 +19,6 @@
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules", "build"],
"include": ["**/*.ts", "**/*.tsx"]
"exclude": ["build", "node_modules"],
"include": ["."]
}

Wyświetl plik

@ -14,7 +14,6 @@ export default defineConfig([
dts: true,
esbuildOptions(options) {
options.target = 'es2020'
options.jsx = 'preserve'
}
}
])

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1,4 @@
packages:
- 'packages/*'
- 'docs'
- 'examples'

40
legacy/turbo.json 100644
Wyświetl plik

@ -0,0 +1,40 @@
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build", "clean"],
"outputs": ["build/**"]
},
"lint": {
"dependsOn": ["^build", "build"]
},
"type-check": {
"dependsOn": ["^build", "build"]
},
"test": {
"dependsOn": [
"^build",
"build",
"unit-test",
"prettier-check",
"eslint-check"
]
},
"prettier-check": {},
"eslint-check": {},
"unit-test": {
"outputs": ["test/.snapshots"]
},
"publint": {
"dependsOn": ["^build", "build"]
},
"clean": {
"dependsOn": ["^clean"],
"outputs": ["build/**", "dist/**"]
},
"dev": {
"cache": false,
"persistent": true
}
}
}

Wyświetl plik

@ -1,13 +1,9 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": [
"./src/index.ts"
],
"entryPoints": ["./packages/core/src/index.ts"],
"tsconfig": "./tsconfig.json",
"readme": "./readme.md",
"plugin": [
"typedoc-plugin-markdown"
],
"plugin": ["typedoc-plugin-markdown"],
"out": "./docs/api",
"hideGenerator": true,
"excludePrivate": true,