open-agents-ai 0.184.37 → 0.184.39
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/README.md +86 -0
- package/dist/index.js +545 -240
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -505,6 +505,88 @@ OA_API_KEYS="grafana-key:read:grafana,ci-key:run:github-actions,ops-key:admin:op
|
|
|
505
505
|
curl -H "Authorization: Bearer ops-key" http://localhost:11435/v1/models
|
|
506
506
|
```
|
|
507
507
|
|
|
508
|
+
#### Tool-Use Profiles
|
|
509
|
+
|
|
510
|
+
Enterprise access control — define which tools, shell commands, and settings the agent can use per API key or per request.
|
|
511
|
+
|
|
512
|
+
**3 built-in presets:**
|
|
513
|
+
|
|
514
|
+
| Profile | Description | Tools |
|
|
515
|
+
|---------|-------------|-------|
|
|
516
|
+
| `full` | No restrictions | All tools and commands |
|
|
517
|
+
| `ci-safe` | CI/CD — read + test only | file_read, grep, shell (npm test only) |
|
|
518
|
+
| `readonly` | Read-only analysis | No writes, no shell mutations |
|
|
519
|
+
|
|
520
|
+
```bash
|
|
521
|
+
# List all profiles (presets + custom)
|
|
522
|
+
curl -H "Authorization: Bearer $KEY" http://localhost:11435/v1/profiles
|
|
523
|
+
```
|
|
524
|
+
```json
|
|
525
|
+
{"profiles":[{"name":"readonly","description":"Read-only","encrypted":false,"source":"preset"},{"name":"ci-safe",...}]}
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
```bash
|
|
529
|
+
# Get profile details
|
|
530
|
+
curl -H "Authorization: Bearer $KEY" http://localhost:11435/v1/profiles/ci-safe
|
|
531
|
+
```
|
|
532
|
+
```json
|
|
533
|
+
{"profile":{"name":"ci-safe","tools":{"allow":["file_read","grep_search","shell"],"shell_allow":["npm test","npx eslint"]},"limits":{"max_turns":15}}}
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
```bash
|
|
537
|
+
# Create custom profile (admin only)
|
|
538
|
+
curl -X POST http://localhost:11435/v1/profiles \
|
|
539
|
+
-H "Authorization: Bearer $ADMIN_KEY" \
|
|
540
|
+
-H "Content-Type: application/json" \
|
|
541
|
+
-d '{
|
|
542
|
+
"name": "frontend-dev",
|
|
543
|
+
"description": "Frontend team — no backend access",
|
|
544
|
+
"tools": {
|
|
545
|
+
"allow": ["file_read", "file_write", "file_edit", "shell", "grep_search"],
|
|
546
|
+
"shell_deny": ["rm -rf", "sudo", "docker", "kubectl"]
|
|
547
|
+
},
|
|
548
|
+
"commands": { "deny": ["destroy", "expose", "sponsor"] },
|
|
549
|
+
"limits": { "max_turns": 20, "timeout_s": 300 }
|
|
550
|
+
}'
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
```bash
|
|
554
|
+
# Create password-protected profile (AES-256-GCM encrypted)
|
|
555
|
+
curl -X POST http://localhost:11435/v1/profiles \
|
|
556
|
+
-H "Authorization: Bearer $ADMIN_KEY" \
|
|
557
|
+
-H "Content-Type: application/json" \
|
|
558
|
+
-d '{"name":"prod-ops","password":"s3cret","tools":{"deny":["file_write"]}}'
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
```bash
|
|
562
|
+
# Use a profile with /v1/run (header or body)
|
|
563
|
+
curl -X POST http://localhost:11435/v1/run \
|
|
564
|
+
-H "Authorization: Bearer $KEY" \
|
|
565
|
+
-H "X-Tool-Profile: ci-safe" \
|
|
566
|
+
-H "X-Working-Directory: $(pwd)" \
|
|
567
|
+
-H "Content-Type: application/json" \
|
|
568
|
+
-d '{"task":"run the test suite and report failures"}'
|
|
569
|
+
|
|
570
|
+
# Or in the body:
|
|
571
|
+
curl -X POST http://localhost:11435/v1/run \
|
|
572
|
+
-H "Authorization: Bearer $KEY" \
|
|
573
|
+
-H "Content-Type: application/json" \
|
|
574
|
+
-d '{"task":"analyze code quality","profile":"readonly"}'
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
```bash
|
|
578
|
+
# Load encrypted profile (password in header)
|
|
579
|
+
curl -H "Authorization: Bearer $KEY" \
|
|
580
|
+
-H "X-Profile-Password: s3cret" \
|
|
581
|
+
http://localhost:11435/v1/profiles/prod-ops
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
```bash
|
|
585
|
+
# Delete a custom profile (admin only, presets cannot be deleted)
|
|
586
|
+
curl -X DELETE -H "Authorization: Bearer $ADMIN_KEY" \
|
|
587
|
+
http://localhost:11435/v1/profiles/frontend-dev
|
|
588
|
+
```
|
|
589
|
+
|
|
508
590
|
#### Endpoint Reference
|
|
509
591
|
|
|
510
592
|
| Method | Path | Auth | Description |
|
|
@@ -529,6 +611,10 @@ curl -H "Authorization: Bearer ops-key" http://localhost:11435/v1/models
|
|
|
529
611
|
| PUT | `/v1/config/endpoint` | admin | Switch endpoint |
|
|
530
612
|
| GET | `/v1/commands` | read | List commands |
|
|
531
613
|
| POST | `/v1/commands/:cmd` | run | Execute command |
|
|
614
|
+
| GET | `/v1/profiles` | read | List all profiles (presets + custom) |
|
|
615
|
+
| GET | `/v1/profiles/:name` | read | Get profile details (X-Profile-Password for encrypted) |
|
|
616
|
+
| POST | `/v1/profiles` | admin | Create/update profile (password field for encryption) |
|
|
617
|
+
| DELETE | `/v1/profiles/:name` | admin | Delete custom profile |
|
|
532
618
|
|
|
533
619
|
### Enterprise Licensing
|
|
534
620
|
|