agentspd 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +333 -0
- package/dist/api.d.ts +198 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +171 -0
- package/dist/commands/agents.d.ts +3 -0
- package/dist/commands/agents.d.ts.map +1 -0
- package/dist/commands/agents.js +277 -0
- package/dist/commands/audit.d.ts +3 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +181 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +226 -0
- package/dist/commands/config-cmd.d.ts +3 -0
- package/dist/commands/config-cmd.d.ts.map +1 -0
- package/dist/commands/config-cmd.js +111 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +8 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +275 -0
- package/dist/commands/policies.d.ts +3 -0
- package/dist/commands/policies.d.ts.map +1 -0
- package/dist/commands/policies.js +362 -0
- package/dist/commands/threats.d.ts +3 -0
- package/dist/commands/threats.d.ts.map +1 -0
- package/dist/commands/threats.js +161 -0
- package/dist/commands/webhooks.d.ts +3 -0
- package/dist/commands/webhooks.d.ts.map +1 -0
- package/dist/commands/webhooks.js +222 -0
- package/dist/config.d.ts +24 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +58 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +328 -0
- package/dist/output.d.ts +60 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +212 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Emotos
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
# Emotos CLI
|
|
2
|
+
|
|
3
|
+
Command-line interface for the Emotos security platform. Manage AI agents, security policies, audit logs, and more.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Quick Install (Recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
curl -fsSL https://api.emotos.ai/v1/cli/install.sh | bash
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This one-liner will:
|
|
14
|
+
- Check for Node.js 20+
|
|
15
|
+
- Install the CLI globally via npm
|
|
16
|
+
- Display helpful next steps
|
|
17
|
+
|
|
18
|
+
### Install via npm
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g agentspd
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Verify Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
agentspd --version
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Requirements
|
|
31
|
+
|
|
32
|
+
- **Node.js 20** or higher
|
|
33
|
+
- npm (comes with Node.js)
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### 1. Create an Account
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
agentspd auth signup
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or log in if you already have an account:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
agentspd auth login
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 2. Check Your Status
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
agentspd auth whoami
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 3. Create a Security Policy
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Generate a policy template
|
|
59
|
+
agentspd policies init --output my-policy.yaml
|
|
60
|
+
|
|
61
|
+
# Edit the policy, then upload it
|
|
62
|
+
agentspd policies create --name "My Policy" --file my-policy.yaml
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 4. Register an Agent
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
agentspd agents create \
|
|
69
|
+
--name "my-support-agent" \
|
|
70
|
+
--environment production \
|
|
71
|
+
--policy pol_abc123
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Important:** Save the API key returned - it won't be shown again!
|
|
75
|
+
|
|
76
|
+
### 5. Issue a JWT Token
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
agentspd agents token agent_xyz789 --ttl 3600
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Use this token to connect to the MCP proxy.
|
|
83
|
+
|
|
84
|
+
## Commands
|
|
85
|
+
|
|
86
|
+
### Authentication
|
|
87
|
+
|
|
88
|
+
| Command | Description |
|
|
89
|
+
|---------|-------------|
|
|
90
|
+
| `agentspd auth signup` | Create a new account |
|
|
91
|
+
| `agentspd auth login` | Log in to Emotos |
|
|
92
|
+
| `agentspd auth logout` | Log out |
|
|
93
|
+
| `agentspd auth whoami` | Show current user |
|
|
94
|
+
| `agentspd auth status` | Check auth status |
|
|
95
|
+
|
|
96
|
+
### Agents
|
|
97
|
+
|
|
98
|
+
| Command | Description |
|
|
99
|
+
|---------|-------------|
|
|
100
|
+
| `agentspd agents create` | Register a new agent |
|
|
101
|
+
| `agentspd agents list` | List all agents |
|
|
102
|
+
| `agentspd agents get <id>` | Get agent details |
|
|
103
|
+
| `agentspd agents token <id>` | Issue JWT token |
|
|
104
|
+
| `agentspd agents revoke <id>` | Revoke agent |
|
|
105
|
+
| `agentspd agents rotate <id>` | Rotate credentials |
|
|
106
|
+
| `agentspd agents monitor <id>` | Monitor activity |
|
|
107
|
+
|
|
108
|
+
### Policies
|
|
109
|
+
|
|
110
|
+
| Command | Description |
|
|
111
|
+
|---------|-------------|
|
|
112
|
+
| `agentspd policies create` | Create policy |
|
|
113
|
+
| `agentspd policies list` | List policies |
|
|
114
|
+
| `agentspd policies get <id>` | Get policy details |
|
|
115
|
+
| `agentspd policies update <id>` | Update policy |
|
|
116
|
+
| `agentspd policies validate <file>` | Validate policy file |
|
|
117
|
+
| `agentspd policies init` | Create template |
|
|
118
|
+
|
|
119
|
+
### Threats
|
|
120
|
+
|
|
121
|
+
| Command | Description |
|
|
122
|
+
|---------|-------------|
|
|
123
|
+
| `agentspd threats list` | List threats |
|
|
124
|
+
| `agentspd threats resolve <id>` | Mark resolved |
|
|
125
|
+
| `agentspd threats watch` | Real-time monitor |
|
|
126
|
+
| `agentspd threats stats` | Threat statistics |
|
|
127
|
+
|
|
128
|
+
### Audit
|
|
129
|
+
|
|
130
|
+
| Command | Description |
|
|
131
|
+
|---------|-------------|
|
|
132
|
+
| `agentspd audit events` | Query events |
|
|
133
|
+
| `agentspd audit get <id>` | Event details |
|
|
134
|
+
| `agentspd audit export` | Export to file |
|
|
135
|
+
| `agentspd audit stats` | Statistics |
|
|
136
|
+
|
|
137
|
+
### Webhooks
|
|
138
|
+
|
|
139
|
+
| Command | Description |
|
|
140
|
+
|---------|-------------|
|
|
141
|
+
| `agentspd webhooks create` | Create webhook |
|
|
142
|
+
| `agentspd webhooks list` | List webhooks |
|
|
143
|
+
| `agentspd webhooks delete <id>` | Delete webhook |
|
|
144
|
+
| `agentspd webhooks test <id>` | Test webhook |
|
|
145
|
+
|
|
146
|
+
### Configuration
|
|
147
|
+
|
|
148
|
+
| Command | Description |
|
|
149
|
+
|---------|-------------|
|
|
150
|
+
| `agentspd config show` | Show current config |
|
|
151
|
+
| `agentspd config set <key> <value>` | Set config value |
|
|
152
|
+
| `agentspd config reset` | Reset to defaults |
|
|
153
|
+
|
|
154
|
+
## Configuration
|
|
155
|
+
|
|
156
|
+
The CLI stores configuration in `~/.config/emotos/config.json`.
|
|
157
|
+
|
|
158
|
+
### Environment Variables
|
|
159
|
+
|
|
160
|
+
| Variable | Description | Default |
|
|
161
|
+
|----------|-------------|---------|
|
|
162
|
+
| `EMOTOS_API_URL` | API base URL | `https://api.emotos.ai` |
|
|
163
|
+
| `EMOTOS_API_KEY` | API key for authentication | - |
|
|
164
|
+
| `EMOTOS_ORG_ID` | Organization ID | - |
|
|
165
|
+
|
|
166
|
+
### Config File
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"apiUrl": "https://api.emotos.ai",
|
|
171
|
+
"apiKey": "emotos_...",
|
|
172
|
+
"orgId": "org_abc123",
|
|
173
|
+
"orgName": "My Organization"
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Examples
|
|
178
|
+
|
|
179
|
+
### Provider Workflow
|
|
180
|
+
|
|
181
|
+
Deploy a secure AI agent:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# 1. Create a security policy
|
|
185
|
+
agentspd policies init --output my-policy.yaml
|
|
186
|
+
agentspd policies create --name "Production Policy" --file my-policy.yaml
|
|
187
|
+
|
|
188
|
+
# 2. Register your agent
|
|
189
|
+
agentspd agents create \
|
|
190
|
+
--name "my-support-agent" \
|
|
191
|
+
--environment production \
|
|
192
|
+
--policy pol_abc123
|
|
193
|
+
|
|
194
|
+
# 3. Issue a JWT token
|
|
195
|
+
agentspd agents token agent_xyz789 --ttl 3600
|
|
196
|
+
|
|
197
|
+
# 4. Monitor your agent
|
|
198
|
+
agentspd agents monitor agent_xyz789
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Consumer Workflow
|
|
202
|
+
|
|
203
|
+
Protect your systems:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# 1. Set up webhook alerts
|
|
207
|
+
agentspd webhooks create \
|
|
208
|
+
--url https://your-server.com/emotos \
|
|
209
|
+
--events threat.blocked,agent.suspended
|
|
210
|
+
|
|
211
|
+
# 2. Monitor threats in real-time
|
|
212
|
+
agentspd threats watch
|
|
213
|
+
|
|
214
|
+
# 3. Review audit logs
|
|
215
|
+
agentspd audit events --limit 50
|
|
216
|
+
|
|
217
|
+
# 4. Export for compliance
|
|
218
|
+
agentspd audit export \
|
|
219
|
+
--start 2026-01-01 \
|
|
220
|
+
--output audit-report.json
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Policy Example
|
|
224
|
+
|
|
225
|
+
```yaml
|
|
226
|
+
version: "1.0"
|
|
227
|
+
name: "production-policy"
|
|
228
|
+
|
|
229
|
+
settings:
|
|
230
|
+
default_action: deny
|
|
231
|
+
require_identity: true
|
|
232
|
+
|
|
233
|
+
tools:
|
|
234
|
+
# Allow read operations
|
|
235
|
+
- pattern: "read_*"
|
|
236
|
+
action: allow
|
|
237
|
+
|
|
238
|
+
# Block dangerous operations
|
|
239
|
+
- pattern: "exec_*"
|
|
240
|
+
action: deny
|
|
241
|
+
reason: "Execution not permitted"
|
|
242
|
+
|
|
243
|
+
prompt_injection:
|
|
244
|
+
enabled: true
|
|
245
|
+
action: block
|
|
246
|
+
|
|
247
|
+
exfiltration:
|
|
248
|
+
enabled: true
|
|
249
|
+
block_patterns:
|
|
250
|
+
- name: "ssn"
|
|
251
|
+
pattern: "\\d{3}-\\d{2}-\\d{4}"
|
|
252
|
+
- name: "credit_card"
|
|
253
|
+
pattern: "\\d{4}[- ]?\\d{4}[- ]?\\d{4}[- ]?\\d{4}"
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## Troubleshooting
|
|
257
|
+
|
|
258
|
+
### "command not found: agentspd"
|
|
259
|
+
|
|
260
|
+
Your PATH may not include the npm global bin directory:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
# Find npm global bin
|
|
264
|
+
npm config get prefix
|
|
265
|
+
|
|
266
|
+
# Add to PATH (bash)
|
|
267
|
+
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.bashrc
|
|
268
|
+
source ~/.bashrc
|
|
269
|
+
|
|
270
|
+
# Add to PATH (zsh)
|
|
271
|
+
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.zshrc
|
|
272
|
+
source ~/.zshrc
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Authentication Issues
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
# Check current auth status
|
|
279
|
+
agentspd auth status
|
|
280
|
+
|
|
281
|
+
# Re-authenticate
|
|
282
|
+
agentspd auth logout
|
|
283
|
+
agentspd auth login
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Connection Errors
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
# Check API connectivity
|
|
290
|
+
curl -s https://api.emotos.ai/health
|
|
291
|
+
|
|
292
|
+
# Use custom API URL
|
|
293
|
+
agentspd config set apiUrl https://your-api-url.com
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## Development
|
|
297
|
+
|
|
298
|
+
### Build from Source
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Clone the repository
|
|
302
|
+
git clone https://github.com/emotos/emotos.git
|
|
303
|
+
cd emotos
|
|
304
|
+
|
|
305
|
+
# Install dependencies
|
|
306
|
+
make install
|
|
307
|
+
|
|
308
|
+
# Build CLI
|
|
309
|
+
make cli-build
|
|
310
|
+
|
|
311
|
+
# Link for local development
|
|
312
|
+
make cli-link
|
|
313
|
+
|
|
314
|
+
# Test
|
|
315
|
+
agentspd --help
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Create Distribution Package
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
make cli-pack
|
|
322
|
+
# Creates cli/emotos-cli.tgz
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
## Support
|
|
326
|
+
|
|
327
|
+
- **Documentation:** https://docs.emotos.ai/cli
|
|
328
|
+
- **Dashboard:** https://app.emotos.ai
|
|
329
|
+
- **Issues:** https://github.com/emotos/emotos/issues
|
|
330
|
+
|
|
331
|
+
## License
|
|
332
|
+
|
|
333
|
+
MIT License - see [LICENSE](../LICENSE) for details.
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
export interface ApiResponse<T> {
|
|
2
|
+
data?: T;
|
|
3
|
+
error?: {
|
|
4
|
+
message: string;
|
|
5
|
+
code?: string;
|
|
6
|
+
};
|
|
7
|
+
status: number;
|
|
8
|
+
}
|
|
9
|
+
export interface Agent {
|
|
10
|
+
id: string;
|
|
11
|
+
orgId: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
status: 'active' | 'suspended' | 'revoked';
|
|
15
|
+
environment: 'development' | 'staging' | 'production';
|
|
16
|
+
reputationScore: number;
|
|
17
|
+
policyId?: string;
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
updatedAt?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface Policy {
|
|
23
|
+
id: string;
|
|
24
|
+
orgId: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
content: string;
|
|
28
|
+
version: string;
|
|
29
|
+
isActive: boolean;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
updatedAt?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface AuditEvent {
|
|
34
|
+
id: string;
|
|
35
|
+
orgId: string;
|
|
36
|
+
agentId: string;
|
|
37
|
+
eventType: string;
|
|
38
|
+
requestData?: Record<string, unknown>;
|
|
39
|
+
responseData?: Record<string, unknown>;
|
|
40
|
+
timestamp: string;
|
|
41
|
+
signature?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface Threat {
|
|
44
|
+
id: string;
|
|
45
|
+
orgId: string;
|
|
46
|
+
agentId: string;
|
|
47
|
+
eventId: string;
|
|
48
|
+
threatType: string;
|
|
49
|
+
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
50
|
+
status: 'detected' | 'blocked' | 'escalated' | 'resolved';
|
|
51
|
+
details: Record<string, unknown>;
|
|
52
|
+
createdAt: string;
|
|
53
|
+
resolvedAt?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface Webhook {
|
|
56
|
+
id: string;
|
|
57
|
+
url: string;
|
|
58
|
+
events: string[];
|
|
59
|
+
createdAt: string;
|
|
60
|
+
}
|
|
61
|
+
export interface TokenResult {
|
|
62
|
+
token: string;
|
|
63
|
+
expiresAt: string;
|
|
64
|
+
}
|
|
65
|
+
export interface PaginatedResult<T> {
|
|
66
|
+
items: T[];
|
|
67
|
+
total: number;
|
|
68
|
+
hasMore: boolean;
|
|
69
|
+
cursor?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface Organization {
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
tier: 'free' | 'pro' | 'enterprise';
|
|
75
|
+
settings: Record<string, unknown>;
|
|
76
|
+
createdAt: string;
|
|
77
|
+
}
|
|
78
|
+
export interface User {
|
|
79
|
+
id: string;
|
|
80
|
+
email: string;
|
|
81
|
+
name: string;
|
|
82
|
+
role: 'provider' | 'consumer' | 'admin';
|
|
83
|
+
createdAt: string;
|
|
84
|
+
}
|
|
85
|
+
declare class EmotosApiClient {
|
|
86
|
+
private request;
|
|
87
|
+
login(email: string, password: string): Promise<ApiResponse<{
|
|
88
|
+
user: User;
|
|
89
|
+
org: Organization;
|
|
90
|
+
sessionToken: string;
|
|
91
|
+
}>>;
|
|
92
|
+
signup(data: {
|
|
93
|
+
email: string;
|
|
94
|
+
password: string;
|
|
95
|
+
name: string;
|
|
96
|
+
role: string;
|
|
97
|
+
orgName?: string;
|
|
98
|
+
}): Promise<ApiResponse<{
|
|
99
|
+
user: User;
|
|
100
|
+
org: Organization;
|
|
101
|
+
sessionToken: string;
|
|
102
|
+
}>>;
|
|
103
|
+
logout(): Promise<ApiResponse<{
|
|
104
|
+
success: boolean;
|
|
105
|
+
}>>;
|
|
106
|
+
me(): Promise<ApiResponse<{
|
|
107
|
+
user: User;
|
|
108
|
+
org: Organization;
|
|
109
|
+
}>>;
|
|
110
|
+
createAgent(data: {
|
|
111
|
+
name: string;
|
|
112
|
+
description?: string;
|
|
113
|
+
environment?: string;
|
|
114
|
+
policyId?: string;
|
|
115
|
+
}): Promise<ApiResponse<Agent>>;
|
|
116
|
+
listAgents(params?: {
|
|
117
|
+
environment?: string;
|
|
118
|
+
status?: string;
|
|
119
|
+
limit?: number;
|
|
120
|
+
offset?: number;
|
|
121
|
+
}): Promise<ApiResponse<PaginatedResult<Agent>>>;
|
|
122
|
+
getAgent(agentId: string): Promise<ApiResponse<Agent>>;
|
|
123
|
+
issueToken(agentId: string, ttlSeconds?: number): Promise<ApiResponse<TokenResult>>;
|
|
124
|
+
revokeAgent(agentId: string): Promise<ApiResponse<{
|
|
125
|
+
success: boolean;
|
|
126
|
+
revokedAt: string;
|
|
127
|
+
}>>;
|
|
128
|
+
rotateCredentials(agentId: string): Promise<ApiResponse<TokenResult & {
|
|
129
|
+
apiKey: string;
|
|
130
|
+
}>>;
|
|
131
|
+
createPolicy(data: {
|
|
132
|
+
name: string;
|
|
133
|
+
description?: string;
|
|
134
|
+
content: string;
|
|
135
|
+
}): Promise<ApiResponse<Policy>>;
|
|
136
|
+
listPolicies(): Promise<ApiResponse<{
|
|
137
|
+
policies: Policy[];
|
|
138
|
+
}>>;
|
|
139
|
+
getPolicy(policyId: string): Promise<ApiResponse<Policy>>;
|
|
140
|
+
updatePolicy(policyId: string, content: string): Promise<ApiResponse<Policy>>;
|
|
141
|
+
validatePolicy(content: string): Promise<ApiResponse<{
|
|
142
|
+
valid: boolean;
|
|
143
|
+
errors?: string[];
|
|
144
|
+
}>>;
|
|
145
|
+
activatePolicy(policyId: string): Promise<ApiResponse<Policy>>;
|
|
146
|
+
deactivatePolicy(policyId: string): Promise<ApiResponse<Policy>>;
|
|
147
|
+
queryAuditEvents(params?: {
|
|
148
|
+
agentId?: string;
|
|
149
|
+
eventType?: string;
|
|
150
|
+
startTime?: string;
|
|
151
|
+
endTime?: string;
|
|
152
|
+
limit?: number;
|
|
153
|
+
}): Promise<ApiResponse<PaginatedResult<AuditEvent>>>;
|
|
154
|
+
getAuditEvent(eventId: string): Promise<ApiResponse<AuditEvent>>;
|
|
155
|
+
listThreats(params?: {
|
|
156
|
+
agentId?: string;
|
|
157
|
+
severity?: string;
|
|
158
|
+
status?: string;
|
|
159
|
+
limit?: number;
|
|
160
|
+
}): Promise<ApiResponse<PaginatedResult<Threat>>>;
|
|
161
|
+
resolveThreat(threatId: string): Promise<ApiResponse<Threat>>;
|
|
162
|
+
createWebhook(data: {
|
|
163
|
+
url: string;
|
|
164
|
+
events: string[];
|
|
165
|
+
secret?: string;
|
|
166
|
+
}): Promise<ApiResponse<Webhook>>;
|
|
167
|
+
listWebhooks(): Promise<ApiResponse<{
|
|
168
|
+
webhooks: Webhook[];
|
|
169
|
+
}>>;
|
|
170
|
+
deleteWebhook(webhookId: string): Promise<ApiResponse<{
|
|
171
|
+
success: boolean;
|
|
172
|
+
}>>;
|
|
173
|
+
testWebhook(webhookId: string): Promise<ApiResponse<{
|
|
174
|
+
success: boolean;
|
|
175
|
+
statusCode?: number;
|
|
176
|
+
error?: string;
|
|
177
|
+
}>>;
|
|
178
|
+
getOrganization(): Promise<ApiResponse<Organization>>;
|
|
179
|
+
updateOrganization(data: {
|
|
180
|
+
name?: string;
|
|
181
|
+
settings?: Record<string, unknown>;
|
|
182
|
+
}): Promise<ApiResponse<Organization>>;
|
|
183
|
+
rotateOrgApiKey(): Promise<ApiResponse<{
|
|
184
|
+
apiKey: string;
|
|
185
|
+
id: string;
|
|
186
|
+
}>>;
|
|
187
|
+
getMetrics(): Promise<ApiResponse<{
|
|
188
|
+
totalAgents: number;
|
|
189
|
+
activeAgents: number;
|
|
190
|
+
totalRequests: number;
|
|
191
|
+
blockedRequests: number;
|
|
192
|
+
threatCount: number;
|
|
193
|
+
avgReputation: number;
|
|
194
|
+
}>>;
|
|
195
|
+
}
|
|
196
|
+
export declare const api: EmotosApiClient;
|
|
197
|
+
export {};
|
|
198
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;IAC3C,WAAW,EAAE,aA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