Skip to content

Commit 8c1110a

Browse files
Implement TypeScript client for OpenHands Agent Server
- Created complete TypeScript client mirroring Python SDK structure - Implemented RemoteConversation and RemoteWorkspace classes - Added HTTP client with error handling and timeout support - Implemented WebSocket client for real-time events - Created comprehensive type definitions based on Swagger spec - Added build system with TypeScript, ESLint, and Prettier - Included usage examples and documentation - All code compiles successfully and passes linting Co-authored-by: openhands <openhands@all-hands.dev>
1 parent 7c43480 commit 8c1110a

19 files changed

+13347
-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+
};

.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

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"useTabs": false
8+
}

0 commit comments

Comments
 (0)