osuite 2.9.8 → 2.10.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 +69 -37
- package/cli.js +405 -41
- package/osuite.js +9 -2
- package/package.json +2 -1
- package/projectHooks.js +741 -0
- package/reviewSurface.js +10 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) OSuite contributors
|
|
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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# OSuite SDK (v2.
|
|
1
|
+
# OSuite SDK (v2.10.0)
|
|
2
2
|
|
|
3
3
|
**Governed action SDK for AI agents.**
|
|
4
4
|
|
|
@@ -18,6 +18,8 @@ curl -fsSL https://studio.osuite.ai/install.sh | bash
|
|
|
18
18
|
|
|
19
19
|
The installer detects Codex, Claude Code, SDK, or MCP-style projects, opens a browser handoff, and writes the approved runtime environment into the project (`.codex/.env`, `.claude/.env`, or `.osuite/.env`). API keys remain available as a fallback, but the normal path is terminal start -> Studio approval -> terminal auto-finish.
|
|
20
20
|
|
|
21
|
+
It needs Node.js 18 or newer, and Python 3.8 or newer for the Codex and Claude Code hooks (the SDK and MCP lanes do not need Python). It checks both first and says how to install what is missing. When the global npm folder is not writable, it installs the CLI into `~/.osuite/npm` instead of asking for `sudo`.
|
|
22
|
+
|
|
21
23
|
### Python
|
|
22
24
|
```bash
|
|
23
25
|
pip install requests
|
|
@@ -142,7 +144,8 @@ osuite external configure \
|
|
|
142
144
|
--mode shadow \
|
|
143
145
|
--account-model customer_managed \
|
|
144
146
|
--api-key "$BABYBLUE_IVV_BEARER" \
|
|
145
|
-
--account-id "$BABYBLUE_IVV_AGENT_ID"
|
|
147
|
+
--account-id "$BABYBLUE_IVV_AGENT_ID" \
|
|
148
|
+
--expected-source-class independent_mediator
|
|
146
149
|
```
|
|
147
150
|
|
|
148
151
|
SDK setup:
|
|
@@ -157,6 +160,7 @@ await osuite.configureExternalVerifier({
|
|
|
157
160
|
account_model: 'customer_managed',
|
|
158
161
|
api_key: process.env.BABYBLUE_IVV_BEARER,
|
|
159
162
|
account_id: process.env.BABYBLUE_IVV_AGENT_ID,
|
|
163
|
+
expected_source_class: 'independent_mediator',
|
|
160
164
|
}],
|
|
161
165
|
});
|
|
162
166
|
```
|
|
@@ -379,72 +383,70 @@ await osuite.syncState({
|
|
|
379
383
|
|
|
380
384
|
## Agent Identity
|
|
381
385
|
|
|
382
|
-
Enroll agents via public-key pairing and manage approved identities for signature verification.
|
|
383
|
-
|
|
384
|
-
### Create Pairing
|
|
386
|
+
Enroll agents via public-key pairing and manage approved identities for signature verification. The current Node client, including `osuite/legacy`, does not expose pairing or identity-management helpers. Use the REST endpoints below with a workspace owner/admin credential; this does not grant an agent permission to approve its own actions.
|
|
385
387
|
|
|
386
388
|
```javascript
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
389
|
+
async function identityRequest(route, { method = 'GET', body } = {}) {
|
|
390
|
+
const response = await fetch(`${baseUrl}${route}`, {
|
|
391
|
+
method,
|
|
392
|
+
headers: { 'content-type': 'application/json', 'x-api-key': adminApiKey },
|
|
393
|
+
...(body === undefined ? {} : { body: JSON.stringify(body) })
|
|
394
|
+
});
|
|
395
|
+
if (!response.ok) throw new Error(`Identity request failed: ${response.status}`);
|
|
396
|
+
return response.json();
|
|
397
|
+
}
|
|
393
398
|
```
|
|
394
399
|
|
|
395
|
-
###
|
|
400
|
+
### Create Pairing
|
|
396
401
|
|
|
397
402
|
```javascript
|
|
398
|
-
const
|
|
403
|
+
const { pairing } = await identityRequest('/api/pairings', {
|
|
404
|
+
method: 'POST',
|
|
405
|
+
body: { agent_id: agentId, agent_name: 'my-agent', public_key: publicKeyPem, algorithm: 'RSASSA-PKCS1-v1_5' }
|
|
406
|
+
});
|
|
407
|
+
console.log(pairing.id); // pair_...
|
|
399
408
|
```
|
|
400
409
|
|
|
401
410
|
### Get Pairing
|
|
402
411
|
|
|
403
412
|
```javascript
|
|
404
|
-
const status = await
|
|
413
|
+
const status = await identityRequest(`/api/pairings/${encodeURIComponent(pairing.id)}`);
|
|
405
414
|
console.log(status.pairing.status); // pending | approved | expired
|
|
406
415
|
```
|
|
407
416
|
|
|
417
|
+
Poll this GET with a bounded timeout while an administrator reviews the pairing. Do not create another pairing just because its status is still pending or a response was lost.
|
|
418
|
+
|
|
408
419
|
### Approve Pairing (Admin)
|
|
409
420
|
|
|
410
421
|
```javascript
|
|
411
|
-
|
|
412
|
-
const res = await fetch(`${baseUrl}/api/pairings/${pairingId}/approve`, {
|
|
413
|
-
method: 'POST',
|
|
414
|
-
headers: { 'x-api-key': adminApiKey }
|
|
415
|
-
});
|
|
422
|
+
await identityRequest(`/api/pairings/${encodeURIComponent(pairing.id)}/approve`, { method: 'POST' });
|
|
416
423
|
```
|
|
417
424
|
|
|
418
425
|
### List Pairings (Admin)
|
|
419
426
|
|
|
420
427
|
```javascript
|
|
421
|
-
const
|
|
422
|
-
headers: { 'x-api-key': adminApiKey }
|
|
423
|
-
});
|
|
424
|
-
const { pairings } = await res.json();
|
|
428
|
+
const { pairings } = await identityRequest('/api/pairings');
|
|
425
429
|
```
|
|
426
430
|
|
|
427
431
|
### Register Identity (Admin)
|
|
428
432
|
|
|
429
433
|
```javascript
|
|
430
|
-
|
|
431
|
-
|
|
434
|
+
await identityRequest('/api/identities', {
|
|
435
|
+
method: 'POST',
|
|
436
|
+
body: { agent_id: 'agent-007', public_key: publicKeyPem, algorithm: 'RSASSA-PKCS1-v1_5' }
|
|
437
|
+
});
|
|
432
438
|
```
|
|
433
439
|
|
|
434
440
|
### List Identities (Admin)
|
|
435
441
|
|
|
436
442
|
```javascript
|
|
437
|
-
const { identities } = await
|
|
443
|
+
const { identities } = await identityRequest('/api/identities');
|
|
438
444
|
```
|
|
439
445
|
|
|
440
446
|
### Revoke Identity (Admin)
|
|
441
447
|
|
|
442
448
|
```javascript
|
|
443
|
-
|
|
444
|
-
const res = await fetch(`${baseUrl}/api/identities/${agentId}`, {
|
|
445
|
-
method: 'DELETE',
|
|
446
|
-
headers: { 'x-api-key': adminApiKey }
|
|
447
|
-
});
|
|
449
|
+
await identityRequest(`/api/identities/${encodeURIComponent(agentId)}`, { method: 'DELETE' });
|
|
448
450
|
```
|
|
449
451
|
|
|
450
452
|
---
|
|
@@ -510,20 +512,50 @@ osuite status # show the current Studio connection
|
|
|
510
512
|
osuite init codex # install .codex hook files into the current project
|
|
511
513
|
osuite init claude # install .claude hook files into the current project
|
|
512
514
|
osuite explain "git push origin main"
|
|
515
|
+
osuite adapters # explain Runtime Coverage tiers
|
|
516
|
+
osuite adapters coverage # show workspace coverage path
|
|
517
|
+
osuite adapter init acme-erp # scaffold an enterprise custom adapter mapping
|
|
518
|
+
osuite adapter test .osuite/adapters/acme-erp.json
|
|
513
519
|
osuite approvals # approval inbox
|
|
514
520
|
osuite review <actionId> # Decision V2 review surface
|
|
515
|
-
osuite approve <actionId> # approve
|
|
521
|
+
osuite approve <actionId> # approve from the CLI where the workspace allows it; otherwise prints the Studio link
|
|
516
522
|
osuite deny <actionId> # deny a specific action
|
|
517
523
|
```
|
|
518
524
|
|
|
519
|
-
For local CLI agents, `osuite connect auto`
|
|
525
|
+
For local CLI agents, `osuite connect auto` opens the browser handoff in your browser (or prints the link with `--no-browser`, in CI, over SSH, or without a terminal), waits as long as the one-time code is valid (about 10 minutes), and installs the project hook lane when it can detect Codex or Claude Code. If browser handoff is unavailable, copy `.codex/.env.example` or `.claude/.env.example` to `.env`, fill `OSUITE_API_KEY`, and run the agent from the same project root. The CLI is intentionally more than an API wrapper:
|
|
520
526
|
- `doctor` tells a developer what is missing before they connect an agent.
|
|
521
527
|
- `explain` gives a local CAVA preview before a command reaches OSuite.
|
|
528
|
+
- `adapters` explains the three Runtime Coverage tiers: reference adapters, managed OSuite adapters, and enterprise custom adapters.
|
|
529
|
+
- `adapter init/test` lets an enterprise team map a private runtime event into a CAVA-ready action object before registering it in Studio.
|
|
522
530
|
- `approvals` provides a readable approval inbox instead of raw JSON.
|
|
523
531
|
- `review` renders a PCAA/CAVA/Decision V2 review card with action understanding, evidence confidence, control posture, and score dimensions when present.
|
|
524
532
|
|
|
533
|
+
Project installation refuses settings, credentials, or hook paths whose symlinks resolve outside the project's real root, including linked parent directories. Existing settings are merged; `disableAllHooks: true` and explicit Codex hook-disable flags stay disabled even with `--force`. Disabled setup is reported as not ready, not as a successful connection.
|
|
534
|
+
|
|
535
|
+
`doctor` separates hook configuration, project enablement, credentials, connectivity, telemetry, and an enforced policy outcome. Observation-only mode, an unavailable guard (whether fail-open or fail-closed), or telemetry without a matching policy outcome does not pass the governance check. Hook warnings are printed even when the probe otherwise succeeds. The probe never executes its sample tool command and does not prove the host loaded the hooks: start or restart the runtime and verify its actual hook invocation separately.
|
|
536
|
+
|
|
525
537
|
When an agent calls `waitForApproval()`, it prints the action ID and replay link to stdout. Approve from any terminal or the dashboard, and the agent unblocks instantly.
|
|
526
538
|
|
|
539
|
+
### Runtime Coverage tiers
|
|
540
|
+
|
|
541
|
+
CAVA itself stays stable: it defines the canonical action object, semantic fingerprint, and approval binding. Runtime Coverage is the adapter layer around CAVA. It explains how much of a customer's real runtime surface is being translated into that canonical object.
|
|
542
|
+
|
|
543
|
+
| Tier | Who uses it | What it means |
|
|
544
|
+
| --- | --- | --- |
|
|
545
|
+
| Reference adapters | Developers and researchers | Open parser-pack contracts and reproducible examples. Useful for local tests and papers, not a promise that every enterprise runtime is covered. |
|
|
546
|
+
| Managed OSuite adapters | Most teams using Codex, Claude, ChatGPT Apps, MCP, SDK hooks, or workflow runtimes | OSuite-maintained parser posture, evidence gaps, and remediation paths shown in Studio Runtime Security. |
|
|
547
|
+
| Enterprise custom adapters | Customers with private ERP, CRM, ticketing, payment, manufacturing, warehouse, or internal workflow systems | Customer-specific field mapping, versioning, policy routing, and proof export without changing CAVA core. |
|
|
548
|
+
|
|
549
|
+
For an enterprise custom runtime:
|
|
550
|
+
|
|
551
|
+
```bash
|
|
552
|
+
osuite adapter init acme-erp
|
|
553
|
+
osuite adapter test .osuite/adapters/acme-erp.json
|
|
554
|
+
osuite adapters coverage
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
The generated mapping file lives under `.osuite/adapters/`. It is intentionally reviewable JSON: the runtime owner can see which fields become actor, operation, target, data boundary, authority boundary, and reversibility before the mapping is registered in Studio.
|
|
558
|
+
|
|
527
559
|
## Claude Code Hooks
|
|
528
560
|
|
|
529
561
|
Govern Claude Code tool calls without any SDK instrumentation. The preferred path is the project-root installer:
|
|
@@ -536,16 +568,16 @@ It detects `.claude`, creates `.claude/hooks/*`, `.claude/settings.json`, `.clau
|
|
|
536
568
|
|
|
537
569
|
---
|
|
538
570
|
|
|
539
|
-
##
|
|
571
|
+
## Legacy Import Compatibility
|
|
540
572
|
|
|
541
|
-
|
|
573
|
+
`osuite/legacy` currently aliases the v2 client. It preserves the import path, not the full historical v1 method surface. ESM and CommonJS expose the same current client capabilities.
|
|
542
574
|
|
|
543
575
|
```javascript
|
|
544
|
-
//
|
|
576
|
+
// Compatibility import for the current client
|
|
545
577
|
import { OSuite } from 'osuite/legacy';
|
|
546
578
|
```
|
|
547
579
|
|
|
548
|
-
|
|
580
|
+
If older code depends on methods not listed in this SDK, migrate those calls to documented REST endpoints or review its existing pinned version before upgrading. Importing `osuite/legacy` does not restore removed methods. Python client releases are separate from this npm package.
|
|
549
581
|
|
|
550
582
|
---
|
|
551
583
|
|