Skip to content

Commit 8667b9b

Browse files
authored
Merge pull request #1 from All-Hands-AI/implement-typescript-client
Implement TypeScript client for OpenHands Agent Server
2 parents 7c43480 + 1e6778e commit 8667b9b

26 files changed

+13903
-0
lines changed

.eslintrc.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
],
7+
plugins: ['@typescript-eslint'],
8+
parserOptions: {
9+
ecmaVersion: 2020,
10+
sourceType: 'module',
11+
},
12+
env: {
13+
node: true,
14+
es6: true,
15+
},
16+
rules: {
17+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
18+
'@typescript-eslint/no-explicit-any': 'warn',
19+
'@typescript-eslint/explicit-function-return-type': 'off',
20+
'@typescript-eslint/explicit-module-boundary-types': 'off',
21+
'@typescript-eslint/no-non-null-assertion': 'warn',
22+
'prefer-const': 'error',
23+
'no-var': 'error',
24+
},
25+
};

.github/dependabot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
time: "09:00"
9+
open-pull-requests-limit: 10
10+
reviewers:
11+
- "All-Hands-AI/core-team"
12+
assignees:
13+
- "All-Hands-AI/core-team"
14+
commit-message:
15+
prefix: "deps"
16+
include: "scope"
17+
groups:
18+
typescript:
19+
patterns:
20+
- "typescript"
21+
- "@typescript-eslint/*"
22+
testing:
23+
patterns:
24+
- "jest"
25+
- "@types/jest"
26+
- "@jest/*"
27+
linting:
28+
patterns:
29+
- "eslint"
30+
- "prettier"
31+
- "@typescript-eslint/*"

.github/workflows/ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x, 22.x]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run linter
31+
run: npm run lint
32+
33+
- name: Run type check
34+
run: npm run build
35+
36+
- name: Run tests
37+
run: npm test
38+
39+
- name: Check formatting
40+
run: npm run format:check
41+
42+
build:
43+
runs-on: ubuntu-latest
44+
needs: test
45+
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
50+
- name: Use Node.js 20.x
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: 20.x
54+
cache: 'npm'
55+
56+
- name: Install dependencies
57+
run: npm ci
58+
59+
- name: Build package
60+
run: npm run build
61+
62+
- name: Upload build artifacts
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: dist
66+
path: dist/
67+
retention-days: 7
68+
69+
security:
70+
runs-on: ubuntu-latest
71+
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v4
75+
76+
- name: Use Node.js 20.x
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version: 20.x
80+
cache: 'npm'
81+
82+
- name: Install dependencies
83+
run: npm ci
84+
85+
- name: Run security audit
86+
run: npm audit --audit-level=moderate
87+
88+
- name: Check for vulnerabilities
89+
run: npm audit --audit-level=high --production
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Dependabot Auto-merge
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
auto-merge:
9+
runs-on: ubuntu-latest
10+
if: github.actor == 'dependabot[bot]'
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Use Node.js 20.x
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20.x
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Run tests
26+
run: npm test
27+
28+
- name: Run build
29+
run: npm run build
30+
31+
- name: Auto-merge minor and patch updates
32+
uses: pascalgn/merge-action@v0.15.6
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
merge_method: squash
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Use Node.js 20.x
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20.x
20+
cache: 'npm'
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run tests
27+
run: npm test
28+
29+
- name: Build package
30+
run: npm run build
31+
32+
- name: Publish to npm
33+
run: npm publish --access public
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
37+
- name: Create GitHub Release
38+
uses: actions/create-release@v1
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
with:
42+
tag_name: ${{ github.ref }}
43+
release_name: Release ${{ github.ref }}
44+
draft: false
45+
prerelease: false
46+
body: |
47+
## Changes
48+
49+
See [CHANGELOG.md](CHANGELOG.md) for details.
50+
51+
## Installation
52+
53+
```bash
54+
npm install @openhands/agent-server-typescript-client@${{ github.ref_name }}
55+
```

.gitignore

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Build outputs
8+
dist/
9+
build/
10+
*.tsbuildinfo
11+
12+
# Environment variables
13+
.env
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local
18+
19+
# IDE files
20+
.vscode/
21+
.idea/
22+
*.swp
23+
*.swo
24+
*~
25+
26+
# OS generated files
27+
.DS_Store
28+
.DS_Store?
29+
._*
30+
.Spotlight-V100
31+
.Trashes
32+
ehthumbs.db
33+
Thumbs.db
34+
35+
# Logs
36+
logs/
37+
*.log
38+
39+
# Coverage directory used by tools like istanbul
40+
coverage/
41+
*.lcov
42+
43+
# nyc test coverage
44+
.nyc_output
45+
46+
# Dependency directories
47+
jspm_packages/
48+
49+
# Optional npm cache directory
50+
.npm
51+
52+
# Optional eslint cache
53+
.eslintcache
54+
55+
# Microbundle cache
56+
.rpt2_cache/
57+
.rts2_cache_cjs/
58+
.rts2_cache_es/
59+
.rts2_cache_umd/
60+
61+
# Optional REPL history
62+
.node_repl_history
63+
64+
# Output of 'npm pack'
65+
*.tgz
66+
67+
# Yarn Integrity file
68+
.yarn-integrity
69+
70+
# parcel-bundler cache (https://parceljs.org/)
71+
.cache
72+
.parcel-cache
73+
74+
# next.js build output
75+
.next
76+
77+
# nuxt.js build output
78+
.nuxt
79+
80+
# vuepress build output
81+
.vuepress/dist
82+
83+
# Serverless directories
84+
.serverless
85+
86+
# FuseBox cache
87+
.fusebox/
88+
89+
# DynamoDB Local files
90+
.dynamodb/
91+
92+
# TernJS port file
93+
.tern-port

0 commit comments

Comments
 (0)