computer-agents 2.2.0__tar.gz

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.
Files changed (29) hide show
  1. computer_agents-2.2.0/.gitignore +181 -0
  2. computer_agents-2.2.0/PKG-INFO +204 -0
  3. computer_agents-2.2.0/README.md +179 -0
  4. computer_agents-2.2.0/computer_agents/__init__.py +198 -0
  5. computer_agents-2.2.0/computer_agents/_api_client.py +296 -0
  6. computer_agents-2.2.0/computer_agents/_exceptions.py +32 -0
  7. computer_agents-2.2.0/computer_agents/client.py +272 -0
  8. computer_agents-2.2.0/computer_agents/py.typed +0 -0
  9. computer_agents-2.2.0/computer_agents/resources/__init__.py +29 -0
  10. computer_agents-2.2.0/computer_agents/resources/agents.py +106 -0
  11. computer_agents-2.2.0/computer_agents/resources/budget.py +210 -0
  12. computer_agents-2.2.0/computer_agents/resources/environments.py +332 -0
  13. computer_agents-2.2.0/computer_agents/resources/files.py +141 -0
  14. computer_agents-2.2.0/computer_agents/resources/git.py +70 -0
  15. computer_agents-2.2.0/computer_agents/resources/orchestrations.py +140 -0
  16. computer_agents-2.2.0/computer_agents/resources/projects.py +60 -0
  17. computer_agents-2.2.0/computer_agents/resources/runs.py +133 -0
  18. computer_agents-2.2.0/computer_agents/resources/schedules.py +144 -0
  19. computer_agents-2.2.0/computer_agents/resources/threads.py +281 -0
  20. computer_agents-2.2.0/computer_agents/resources/triggers.py +150 -0
  21. computer_agents-2.2.0/computer_agents/types.py +915 -0
  22. computer_agents-2.2.0/examples/01_quickstart.py +33 -0
  23. computer_agents-2.2.0/examples/02_threads.py +42 -0
  24. computer_agents-2.2.0/examples/03_environments.py +52 -0
  25. computer_agents-2.2.0/examples/04_agents.py +42 -0
  26. computer_agents-2.2.0/examples/05_files.py +38 -0
  27. computer_agents-2.2.0/examples/06_schedules.py +39 -0
  28. computer_agents-2.2.0/examples/07_git.py +28 -0
  29. computer_agents-2.2.0/pyproject.toml +51 -0
@@ -0,0 +1,181 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ lerna-debug.log*
8
+ .pnpm-debug.log*
9
+
10
+ # Diagnostic reports (https://nodejs.org/api/report.html)
11
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12
+
13
+ # Runtime data
14
+ pids
15
+ *.pid
16
+ *.seed
17
+ *.pid.lock
18
+
19
+ # Directory for instrumented libs generated by jscoverage/JSCover
20
+ lib-cov
21
+
22
+ # Coverage directory used by tools like istanbul
23
+ coverage
24
+ *.lcov
25
+
26
+ # nyc test coverage
27
+ .nyc_output
28
+
29
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30
+ .grunt
31
+
32
+ # Bower dependency directory (https://bower.io/)
33
+ bower_components
34
+
35
+ # node-waf configuration
36
+ .lock-wscript
37
+
38
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
39
+ build/Release
40
+
41
+ # Dependency directories
42
+ node_modules/
43
+ jspm_packages/
44
+
45
+ # Snowpack dependency directory (https://snowpack.dev/)
46
+ web_modules/
47
+
48
+ # TypeScript cache
49
+ *.tsbuildinfo
50
+
51
+ # Optional npm cache directory
52
+ .npm
53
+
54
+ # Optional eslint cache
55
+ .eslintcache
56
+
57
+ # Optional stylelint cache
58
+ .stylelintcache
59
+
60
+ # Microbundle cache
61
+ .rpt2_cache/
62
+ .rts2_cache_cjs/
63
+ .rts2_cache_es/
64
+ .rts2_cache_umd/
65
+
66
+ # Optional REPL history
67
+ .node_repl_history
68
+
69
+ # Output of 'npm pack'
70
+ *.tgz
71
+
72
+ # Yarn Integrity file
73
+ .yarn-integrity
74
+
75
+ # dotenv environment variable files
76
+ .env
77
+ .env.development.local
78
+ .env.test.local
79
+ .env.production.local
80
+ .env.local
81
+
82
+ # parcel-bundler cache (https://parceljs.org/)
83
+ .cache
84
+ .parcel-cache
85
+
86
+ # Next.js build output
87
+ .next
88
+ out
89
+
90
+ # Nuxt.js build / generate output
91
+ .nuxt
92
+ dist
93
+
94
+ # Gatsby files
95
+ .cache/
96
+ # Comment in the public line in if your project uses Gatsby and not Next.js
97
+ # https://nextjs.org/blog/next-9-1#public-directory-support
98
+ # public
99
+
100
+ # vuepress build output
101
+ .vuepress/dist
102
+
103
+ # vuepress v2.x temp and cache directory
104
+ .temp
105
+ .cache
106
+
107
+ # vitepress build output
108
+ **/.vitepress/dist
109
+
110
+ # vitepress cache directory
111
+ **/.vitepress/cache
112
+
113
+ # Docusaurus cache and generated files
114
+ .docusaurus
115
+
116
+ # Serverless directories
117
+ .serverless/
118
+
119
+ # FuseBox cache
120
+ .fusebox/
121
+
122
+ # DynamoDB Local files
123
+ .dynamodb/
124
+
125
+ # TernJS port file
126
+ .tern-port
127
+
128
+ # Stores VSCode versions used for testing VSCode extensions
129
+ .vscode-test
130
+
131
+ # yarn v2
132
+ .yarn/cache
133
+ .yarn/unplugged
134
+ .yarn/build-state.yml
135
+ .yarn/install-state.gz
136
+ .pnp.*
137
+
138
+ packages/*/dist
139
+
140
+ docs/src/content/docs/@openai/*
141
+ docs/src/content/docs/openai/*
142
+
143
+ # Python reference implementation (never published with the JS repo)
144
+ openai-agents-python
145
+
146
+ .DS_Store
147
+
148
+ bundled/
149
+
150
+ .wrangler/
151
+ .dev.vars
152
+
153
+ # Test artifacts
154
+ **/tests/tmp/
155
+ *.db
156
+ *.sqlite
157
+ *.sqlite3
158
+
159
+ # Build artifacts that shouldn't be committed
160
+ FIX_SUMMARY.md
161
+ test-package-exports.mjs
162
+ test-codex-loading.mjs
163
+
164
+ # Internal documentation (not for public repo)
165
+ API_DOCUMENTATION.md
166
+ API_KEY_SYSTEM_COMPLETE.md
167
+ API_KEY_TESTING_RESULTS.md
168
+ API_KEY_MANAGEMENT.md
169
+ BILLING.md
170
+ *INTERNAL*.md
171
+ AUTHENTICATION-UPDATE.md
172
+ PHASE-2-COMPLETE.md
173
+ PRE_PUBLISH_CHECKLIST.md
174
+ REFACTORING_SUMMARY.md
175
+ RENAME_COMPLETE.md
176
+ REPUBLISH_GUIDE.md
177
+ SESSION-SUMMARY.md
178
+ TESTING-SUMMARY.md
179
+ packages/cloud-infrastructure/API_KEY_MANAGEMENT.md
180
+ packages/cloud-infrastructure/BILLING.md
181
+ packages/cloud-infrastructure/BILLING_SYSTEM_COMPLETE.md
@@ -0,0 +1,204 @@
1
+ Metadata-Version: 2.4
2
+ Name: computer-agents
3
+ Version: 2.2.0
4
+ Summary: Official Python SDK for the Computer Agents Cloud API. Execute Claude-powered AI agents in isolated cloud containers.
5
+ Project-URL: Homepage, https://computer-agents.com
6
+ Project-URL: Documentation, https://computer-agents.com/documentation
7
+ Project-URL: Repository, https://github.com/computer-agents/computer-agents-python
8
+ Author: Computer Agents
9
+ License-Expression: MIT
10
+ Keywords: agents,ai,anthropic,api,automation,claude,cloud,code-generation,computer-agents,mcp,sdk
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.9
23
+ Requires-Dist: httpx>=0.25.0
24
+ Description-Content-Type: text/markdown
25
+
26
+ # Computer Agents Python SDK
27
+
28
+ The official Python SDK for the [Computer Agents](https://computer-agents.com) Cloud API. Execute Claude-powered AI agents in isolated cloud containers.
29
+
30
+ ## Installation
31
+
32
+ ```bash
33
+ pip install computer-agents
34
+ ```
35
+
36
+ ## Quick Start
37
+
38
+ ```python
39
+ from computer_agents import ComputerAgentsClient
40
+
41
+ client = ComputerAgentsClient(api_key="ca_your_api_key")
42
+
43
+ # Execute a task
44
+ result = client.run(
45
+ "Create a REST API with Flask",
46
+ environment_id="env_xxx",
47
+ on_event=lambda e: print(e["type"]),
48
+ )
49
+
50
+ print(result.content)
51
+ print(f"Thread ID: {result.thread_id}")
52
+ ```
53
+
54
+ ## Multi-Turn Conversations
55
+
56
+ ```python
57
+ # Create a thread for persistent conversation
58
+ thread = client.threads.create(environment_id="env_xxx")
59
+
60
+ # First message
61
+ result = client.threads.send_message(
62
+ thread["id"],
63
+ content="Create a Python web server",
64
+ on_event=lambda e: print(e),
65
+ )
66
+
67
+ # Follow-up (continues same session)
68
+ result2 = client.threads.send_message(
69
+ thread["id"],
70
+ content="Add authentication to the server",
71
+ )
72
+ ```
73
+
74
+ ## Environments
75
+
76
+ ```python
77
+ # Create a custom environment
78
+ env = client.environments.create(
79
+ name="data-science",
80
+ internet_access=True,
81
+ runtimes={"python": "3.12"},
82
+ )
83
+
84
+ # Install packages
85
+ client.environments.install_packages(env["id"], "python", ["pandas", "numpy"])
86
+
87
+ # Add MCP servers
88
+ client.environments.update(
89
+ env["id"],
90
+ mcp_servers=[{
91
+ "type": "stdio",
92
+ "name": "filesystem",
93
+ "command": "npx",
94
+ "args": ["@modelcontextprotocol/server-filesystem", "/workspace"],
95
+ }],
96
+ )
97
+ ```
98
+
99
+ ## Agents
100
+
101
+ ```python
102
+ # Create a custom agent
103
+ agent = client.agents.create(
104
+ name="Code Reviewer",
105
+ model="claude-sonnet-4-5",
106
+ instructions="You are a thorough code reviewer.",
107
+ enabled_skills=["web_search"],
108
+ )
109
+
110
+ # Use the agent
111
+ thread = client.threads.create(
112
+ environment_id="env_xxx",
113
+ agent_id=agent["id"],
114
+ )
115
+ ```
116
+
117
+ ## Files
118
+
119
+ ```python
120
+ # Upload a file
121
+ client.files.upload_file(
122
+ "env_xxx",
123
+ filename="app.py",
124
+ content='print("hello")',
125
+ path="src",
126
+ )
127
+
128
+ # Download a file
129
+ content = client.files.get_file("env_xxx", "src/app.py")
130
+
131
+ # List files
132
+ files = client.files.list_files("env_xxx")
133
+ ```
134
+
135
+ ## Git Operations
136
+
137
+ ```python
138
+ diff = client.git.diff("env_xxx")
139
+ client.git.commit("env_xxx", message="Update feature")
140
+ client.git.push("env_xxx")
141
+ ```
142
+
143
+ ## Schedules
144
+
145
+ ```python
146
+ schedule = client.schedules.create(
147
+ name="Daily Report",
148
+ agent_id="agent_xxx",
149
+ agent_name="Reporter",
150
+ task="Generate daily report",
151
+ schedule_type="recurring",
152
+ cron_expression="0 9 * * *",
153
+ )
154
+ ```
155
+
156
+ ## Configuration
157
+
158
+ The API key can be provided via:
159
+
160
+ 1. Constructor argument: `ComputerAgentsClient(api_key="ca_...")`
161
+ 2. Environment variable: `COMPUTER_AGENTS_API_KEY`
162
+
163
+ ```python
164
+ # Custom base URL and timeout
165
+ client = ComputerAgentsClient(
166
+ api_key="ca_...",
167
+ base_url="https://custom-api.example.com",
168
+ timeout=120.0,
169
+ debug=True,
170
+ )
171
+ ```
172
+
173
+ ## Context Manager
174
+
175
+ ```python
176
+ with ComputerAgentsClient(api_key="ca_...") as client:
177
+ result = client.run("Hello world", environment_id="env_xxx")
178
+ print(result.content)
179
+ # Client is automatically closed
180
+ ```
181
+
182
+ ## API Resources
183
+
184
+ | Resource | Description |
185
+ |----------|-------------|
186
+ | `client.threads` | Conversation management with SSE streaming |
187
+ | `client.environments` | Environment configuration and container lifecycle |
188
+ | `client.agents` | Agent configuration (model, instructions, skills) |
189
+ | `client.files` | File management in environment workspaces |
190
+ | `client.schedules` | Scheduled task management |
191
+ | `client.triggers` | Event-driven triggers |
192
+ | `client.orchestrations` | Agent-to-agent orchestration |
193
+ | `client.budget` | Budget and usage tracking |
194
+ | `client.billing` | Billing records and statistics |
195
+ | `client.git` | Git operations on workspaces |
196
+
197
+ ## Requirements
198
+
199
+ - Python >= 3.9
200
+ - httpx >= 0.25.0
201
+
202
+ ## License
203
+
204
+ MIT
@@ -0,0 +1,179 @@
1
+ # Computer Agents Python SDK
2
+
3
+ The official Python SDK for the [Computer Agents](https://computer-agents.com) Cloud API. Execute Claude-powered AI agents in isolated cloud containers.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install computer-agents
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```python
14
+ from computer_agents import ComputerAgentsClient
15
+
16
+ client = ComputerAgentsClient(api_key="ca_your_api_key")
17
+
18
+ # Execute a task
19
+ result = client.run(
20
+ "Create a REST API with Flask",
21
+ environment_id="env_xxx",
22
+ on_event=lambda e: print(e["type"]),
23
+ )
24
+
25
+ print(result.content)
26
+ print(f"Thread ID: {result.thread_id}")
27
+ ```
28
+
29
+ ## Multi-Turn Conversations
30
+
31
+ ```python
32
+ # Create a thread for persistent conversation
33
+ thread = client.threads.create(environment_id="env_xxx")
34
+
35
+ # First message
36
+ result = client.threads.send_message(
37
+ thread["id"],
38
+ content="Create a Python web server",
39
+ on_event=lambda e: print(e),
40
+ )
41
+
42
+ # Follow-up (continues same session)
43
+ result2 = client.threads.send_message(
44
+ thread["id"],
45
+ content="Add authentication to the server",
46
+ )
47
+ ```
48
+
49
+ ## Environments
50
+
51
+ ```python
52
+ # Create a custom environment
53
+ env = client.environments.create(
54
+ name="data-science",
55
+ internet_access=True,
56
+ runtimes={"python": "3.12"},
57
+ )
58
+
59
+ # Install packages
60
+ client.environments.install_packages(env["id"], "python", ["pandas", "numpy"])
61
+
62
+ # Add MCP servers
63
+ client.environments.update(
64
+ env["id"],
65
+ mcp_servers=[{
66
+ "type": "stdio",
67
+ "name": "filesystem",
68
+ "command": "npx",
69
+ "args": ["@modelcontextprotocol/server-filesystem", "/workspace"],
70
+ }],
71
+ )
72
+ ```
73
+
74
+ ## Agents
75
+
76
+ ```python
77
+ # Create a custom agent
78
+ agent = client.agents.create(
79
+ name="Code Reviewer",
80
+ model="claude-sonnet-4-5",
81
+ instructions="You are a thorough code reviewer.",
82
+ enabled_skills=["web_search"],
83
+ )
84
+
85
+ # Use the agent
86
+ thread = client.threads.create(
87
+ environment_id="env_xxx",
88
+ agent_id=agent["id"],
89
+ )
90
+ ```
91
+
92
+ ## Files
93
+
94
+ ```python
95
+ # Upload a file
96
+ client.files.upload_file(
97
+ "env_xxx",
98
+ filename="app.py",
99
+ content='print("hello")',
100
+ path="src",
101
+ )
102
+
103
+ # Download a file
104
+ content = client.files.get_file("env_xxx", "src/app.py")
105
+
106
+ # List files
107
+ files = client.files.list_files("env_xxx")
108
+ ```
109
+
110
+ ## Git Operations
111
+
112
+ ```python
113
+ diff = client.git.diff("env_xxx")
114
+ client.git.commit("env_xxx", message="Update feature")
115
+ client.git.push("env_xxx")
116
+ ```
117
+
118
+ ## Schedules
119
+
120
+ ```python
121
+ schedule = client.schedules.create(
122
+ name="Daily Report",
123
+ agent_id="agent_xxx",
124
+ agent_name="Reporter",
125
+ task="Generate daily report",
126
+ schedule_type="recurring",
127
+ cron_expression="0 9 * * *",
128
+ )
129
+ ```
130
+
131
+ ## Configuration
132
+
133
+ The API key can be provided via:
134
+
135
+ 1. Constructor argument: `ComputerAgentsClient(api_key="ca_...")`
136
+ 2. Environment variable: `COMPUTER_AGENTS_API_KEY`
137
+
138
+ ```python
139
+ # Custom base URL and timeout
140
+ client = ComputerAgentsClient(
141
+ api_key="ca_...",
142
+ base_url="https://custom-api.example.com",
143
+ timeout=120.0,
144
+ debug=True,
145
+ )
146
+ ```
147
+
148
+ ## Context Manager
149
+
150
+ ```python
151
+ with ComputerAgentsClient(api_key="ca_...") as client:
152
+ result = client.run("Hello world", environment_id="env_xxx")
153
+ print(result.content)
154
+ # Client is automatically closed
155
+ ```
156
+
157
+ ## API Resources
158
+
159
+ | Resource | Description |
160
+ |----------|-------------|
161
+ | `client.threads` | Conversation management with SSE streaming |
162
+ | `client.environments` | Environment configuration and container lifecycle |
163
+ | `client.agents` | Agent configuration (model, instructions, skills) |
164
+ | `client.files` | File management in environment workspaces |
165
+ | `client.schedules` | Scheduled task management |
166
+ | `client.triggers` | Event-driven triggers |
167
+ | `client.orchestrations` | Agent-to-agent orchestration |
168
+ | `client.budget` | Budget and usage tracking |
169
+ | `client.billing` | Billing records and statistics |
170
+ | `client.git` | Git operations on workspaces |
171
+
172
+ ## Requirements
173
+
174
+ - Python >= 3.9
175
+ - httpx >= 0.25.0
176
+
177
+ ## License
178
+
179
+ MIT