Skip to content

Commit

Permalink
feat: Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
John-peterson-coinbase committed Dec 3, 2024
1 parent 21bb498 commit b19989b
Show file tree
Hide file tree
Showing 67 changed files with 12,991 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .eslintrc.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:jsdoc/recommended"
],
"plugins": ["@typescript-eslint", "prettier"],
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"rules": {
"multiline-comment-style": ["error", "starred-block"],
"prettier/prettier": "error",
"@typescript-eslint/member-ordering": "error",
"jsdoc/tag-lines": ["error", "any", { "startLines": 1 }],
"jsdoc/check-alignment": "error",
"jsdoc/no-undefined-types": "off",
"jsdoc/check-param-names": "error",
"jsdoc/check-tag-names": "error",
"jsdoc/check-types": "error",
"jsdoc/implements-on-classes": "error",
"jsdoc/require-description": "error",
"jsdoc/require-jsdoc": [
"error",
{
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
"ArrowFunctionExpression": false,
"FunctionExpression": false
}
}
],
"jsdoc/require-param": "error",
"jsdoc/require-param-description": "error",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": "error",
"jsdoc/require-returns-description": "error",
"jsdoc/require-returns-type": "off",
"jsdoc/require-hyphen-before-param-description": ["error", "always"]
},
"ignorePatterns": ["src/**/tests/**", "src/**/*.test.ts"]
}
7 changes: 7 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### What changed? Why?


#### Qualified Impact
<!-- Please evaluate what components could be affected and what the impact would be if there was an
error. How would this error be resolved, e.g. rollback a deploy, push a new fix, disable a feature
flag, etc... -->
34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lint

on: [pull_request]

jobs:
lint-agentkit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cdp-agentkit-core
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run typecheck

lint-langchain:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cdp-langchain
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run typecheck
25 changes: 25 additions & 0 deletions .github/workflows/publish_agentkit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release AgentKit Core to NPM

on:
workflow_dispatch:

jobs:
deploy-agentkit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cdp-agentkit-core
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish Docs to Github Pages

on:
workflow_dispatch:

jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

# Build cdp-agentkit-core docs
- name: Build AgentKit Core docs
run: |
cd cdp-agentkit-core
npm ci
npm run docs
cd ..
mkdir -p docs/cdp-agentkit-core
cp -r cdp-agentkit-core/docs/* docs/cdp-agentkit-core/
# Build cdp-langchain docs
- name: Build LangChain docs
run: |
cd cdp-langchain
npm ci
npm run docs
cd ..
mkdir -p docs/cdp-langchain
cp -r cdp-langchain/docs/* docs/cdp-langchain/
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
keep_files: false
25 changes: 25 additions & 0 deletions .github/workflows/publish_langchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish LangChain to NPM

on:
workflow_dispatch:

jobs:
deploy-langchain:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cdp-langchain
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Unit Tests

on: [pull_request]

jobs:
test-agentkit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cdp-agentkit-core
strategy:
matrix:
node-version: ['18', '20']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run test:unit

test-langchain:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cdp-langchain
strategy:
matrix:
node-version: ['18', '20']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run test:unit
91 changes: 91 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
**/.DS_Store

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# IDE
.idea/*
.vscode/*

## Emacs
*~
\#*\#
.\#*
**/.projectile

# Build outputs
dist
out
.next
.nuxt
build/Release
.turbo/

# Coverage
coverage
*.lcov
.nyc_output
lib-cov

# Dependencies
node_modules/
jspm_packages/
bower_components
web_modules/
.pnp.*

# Cache
.npm
.eslintcache
.stylelintcache
.parcel-cache
.cache
.temp
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# IDE
.vscode
.vscode-test
.idea
.tern-port

# Environment Configurations
**/env/
**/.env/
**/.env
**/.env.local/
**/.env.test/

# Runtime data
pids
*.pid
*.seed
*.pid.lock
*.tsbuildinfo
.node_repl_history

# Yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz

# Wallet data
**/wallet_data.txt

# Misc
.DS_Store
**/*_local*
api.json

# JSDoc
docs/
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
docs/
coverage/
.github/
src/client
**/**/*.json
*.md
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "avoid",
"printWidth": 100,
"proseWrap": "never"
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# CDP Node.js AgentKit Changelog

## Unreleased

## [0.0.5] - 2024-11-29

### Added

- Initial release of the CDP Node.js AgentKit.
Loading

0 comments on commit b19989b

Please sign in to comment.