osuite 2.9.7 → 2.9.9

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 (3) hide show
  1. package/README.md +30 -2
  2. package/cli.js +239 -1
  3. package/package.json +10 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # OSuite SDK (v2.9.7)
1
+ # OSuite SDK (v2.9.9)
2
2
 
3
3
  **Governed action SDK for AI agents.**
4
4
 
@@ -142,7 +142,8 @@ osuite external configure \
142
142
  --mode shadow \
143
143
  --account-model customer_managed \
144
144
  --api-key "$BABYBLUE_IVV_BEARER" \
145
- --account-id "$BABYBLUE_IVV_AGENT_ID"
145
+ --account-id "$BABYBLUE_IVV_AGENT_ID" \
146
+ --expected-source-class independent_mediator
146
147
  ```
147
148
 
148
149
  SDK setup:
@@ -157,6 +158,7 @@ await osuite.configureExternalVerifier({
157
158
  account_model: 'customer_managed',
158
159
  api_key: process.env.BABYBLUE_IVV_BEARER,
159
160
  account_id: process.env.BABYBLUE_IVV_AGENT_ID,
161
+ expected_source_class: 'independent_mediator',
160
162
  }],
161
163
  });
162
164
  ```
@@ -510,6 +512,10 @@ 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
521
  osuite approve <actionId> # approve a specific action
@@ -519,11 +525,33 @@ osuite deny <actionId> # deny a specific action
519
525
  For local CLI agents, `osuite connect auto` prints a browser handoff URL 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
 
525
533
  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
534
 
535
+ ### Runtime Coverage tiers
536
+
537
+ 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.
538
+
539
+ | Tier | Who uses it | What it means |
540
+ | --- | --- | --- |
541
+ | 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. |
542
+ | 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. |
543
+ | 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. |
544
+
545
+ For an enterprise custom runtime:
546
+
547
+ ```bash
548
+ osuite adapter init acme-erp
549
+ osuite adapter test .osuite/adapters/acme-erp.json
550
+ osuite adapters coverage
551
+ ```
552
+
553
+ 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.
554
+
527
555
  ## Claude Code Hooks
528
556
 
529
557
  Govern Claude Code tool calls without any SDK instrumentation. The preferred path is the project-root installer:
package/cli.js CHANGED
@@ -55,6 +55,30 @@ const PROJECT_BOOTSTRAPS = {
55
55
  },
56
56
  };
57
57
 
58
+ const RUNTIME_COVERAGE_TIERS = [
59
+ {
60
+ id: 'reference',
61
+ label: 'Reference adapters',
62
+ summary: 'Open CAVA schemas, parser-pack contracts, and reproducible local examples.',
63
+ cli: 'cava scan ./repo --adapter github-actions --adapter package-json',
64
+ studio: 'Shown as reference coverage only; production lanes should upgrade to managed coverage.',
65
+ },
66
+ {
67
+ id: 'managed',
68
+ label: 'Managed OSuite adapters',
69
+ summary: 'OSuite-maintained adapters for Codex, Claude, ChatGPT Apps, MCP, SDK, hooks, and workflow runtimes.',
70
+ cli: 'osuite connect auto && osuite adapters status',
71
+ studio: 'Shown in Runtime Coverage with parser posture, evidence gaps, and remediation paths.',
72
+ },
73
+ {
74
+ id: 'enterprise_custom',
75
+ label: 'Enterprise custom adapters',
76
+ summary: 'Customer-specific mapping for ERP, CRM, ticketing, payments, manufacturing, warehouses, and private workflows.',
77
+ cli: 'osuite adapter init acme-erp && osuite adapter test .osuite/adapters/acme-erp.json',
78
+ studio: 'Shown as customer runtime coverage with versioning, field mapping, approval routing, and proof export.',
79
+ },
80
+ ];
81
+
58
82
  function useColor() {
59
83
  return !process.env.NO_COLOR && process.stdout.isTTY !== false;
60
84
  }
@@ -333,6 +357,75 @@ function writeProjectFile(relativePath, body, { force = false } = {}) {
333
357
  return { relativePath, status: 'written' };
334
358
  }
335
359
 
360
+ function readProjectJsonFile(filePath) {
361
+ const absolute = path.isAbsolute(filePath) ? filePath : projectFilePath(filePath);
362
+ return JSON.parse(fs.readFileSync(absolute, 'utf8'));
363
+ }
364
+
365
+ function slugifyAdapterName(value) {
366
+ const slug = String(value || 'enterprise-runtime')
367
+ .trim()
368
+ .toLowerCase()
369
+ .replace(/[^a-z0-9._-]+/g, '-')
370
+ .replace(/^-+|-+$/g, '');
371
+ return slug || 'enterprise-runtime';
372
+ }
373
+
374
+ function enterpriseAdapterTemplate(adapterId) {
375
+ return {
376
+ schema_version: 'osuite.runtime_adapter_mapping.v1',
377
+ adapter_id: adapterId,
378
+ display_name: adapterId
379
+ .split(/[-_.]+/)
380
+ .filter(Boolean)
381
+ .map((part) => part.slice(0, 1).toUpperCase() + part.slice(1))
382
+ .join(' '),
383
+ coverage_tier: 'enterprise_custom',
384
+ parser_posture: 'enterprise_custom',
385
+ support_model: 'customer_owned_osuite_reviewed',
386
+ description: 'Map a private enterprise runtime event into the CAVA canonical action object.',
387
+ source: {
388
+ kind: 'sample_event',
389
+ runtime_family: 'enterprise_workflow',
390
+ evidence_boundary: 'customer_private_runtime',
391
+ },
392
+ field_map: {
393
+ actor: 'actor.id',
394
+ operation: 'action.operation',
395
+ target: 'action.target',
396
+ systems_touched: 'runtime.system',
397
+ data_boundary: 'data.boundary',
398
+ authority_boundary: 'approval.group',
399
+ reversible: 'action.reversible',
400
+ declared_goal: 'action.goal',
401
+ },
402
+ sample_event: {
403
+ actor: { id: 'agent-or-operator-id' },
404
+ action: {
405
+ operation: 'refund_review',
406
+ target: 'case-123',
407
+ reversible: false,
408
+ goal: 'Review a high-value customer support case before any external side effect.',
409
+ },
410
+ runtime: { system: 'acme-erp' },
411
+ data: { boundary: 'customer_support_context' },
412
+ approval: { group: 'risk-ops' },
413
+ },
414
+ validation: {
415
+ required_fields: [
416
+ 'actor',
417
+ 'operation',
418
+ 'target',
419
+ 'systems_touched',
420
+ 'data_boundary',
421
+ 'authority_boundary',
422
+ 'reversible',
423
+ ],
424
+ expected_output: 'CAVA canonical action object with stable semantic key and approval binding.',
425
+ },
426
+ };
427
+ }
428
+
336
429
  function remapBootstrapPath(spec, relativePath) {
337
430
  if (relativePath === 'README.md') return spec.readmePath;
338
431
  return relativePath;
@@ -406,8 +499,11 @@ function printHelp() {
406
499
  write(' osuite review <actionId> Render the decision review card');
407
500
  write(' osuite approve <actionId> --reason "Looks safe"');
408
501
  write(' osuite deny <actionId> --reason "Outside change window"');
502
+ write(' osuite adapters [status|coverage] Explain Runtime Coverage tiers and next steps');
503
+ write(' osuite adapter init <name> Scaffold an enterprise custom adapter mapping');
504
+ write(' osuite adapter test <file> Validate an enterprise custom adapter mapping');
409
505
  write(' osuite external status Show external verifier network setup and usage');
410
- write(' osuite external configure --provider babyblue_invinoveritas --mode shadow --api-key <key>');
506
+ write(' osuite external configure --provider babyblue_invinoveritas --mode shadow --api-key <key> --expected-source-class independent_mediator');
411
507
  write(' osuite connect [auto|codex|claude|sdk|mcp] Detect runtime and start browser handoff');
412
508
  write(' osuite init [sdk|codex|claude|mcp] Print setup steps for a runtime lane');
413
509
  write('');
@@ -419,6 +515,146 @@ function printHelp() {
419
515
  write(c('Old DASHCLAW_* environment names are still accepted for compatibility.', ANSI.dim));
420
516
  }
421
517
 
518
+ function printRuntimeCoverage(args = {}) {
519
+ const config = readConfig();
520
+ const subcommand = args._[0] || 'status';
521
+ write(c('OSuite Runtime Coverage', `${ANSI.bold}${ANSI.cyan}`));
522
+ write(c('CAVA adapter coverage is split into reference, managed, and enterprise custom layers.', ANSI.dim));
523
+ write('');
524
+
525
+ for (const tier of RUNTIME_COVERAGE_TIERS) {
526
+ write(c(tier.label, ANSI.bold));
527
+ write(` id ${tier.id}`);
528
+ write(` purpose ${tier.summary}`);
529
+ write(` cli ${tier.cli}`);
530
+ write(` studio ${tier.studio}`);
531
+ write(` fields coverage_tier=${tier.id}; parser_posture=${tier.id === 'reference' ? 'reference' : tier.id}`);
532
+ write('');
533
+ }
534
+
535
+ if (subcommand === 'coverage') {
536
+ write(c('Workspace coverage', ANSI.bold));
537
+ if (config.baseUrl && config.apiKey) {
538
+ write(` Studio report ${normalizedBaseUrl(config.baseUrl)}/runtime-security`);
539
+ write(' Export /api/runtime-security/report?format=md&download=1');
540
+ write(' Note The Studio report is the source of truth for connected lanes and parser posture.');
541
+ } else {
542
+ write(' Not connected. Run `osuite connect auto` or set OSUITE_BASE_URL and OSUITE_API_KEY.');
543
+ }
544
+ write('');
545
+ }
546
+
547
+ write(c('Rule of thumb', ANSI.bold));
548
+ write(' Reference teaches the action language. Managed makes common runtimes easy. Enterprise custom maps private systems without changing CAVA core.');
549
+ }
550
+
551
+ function validateEnterpriseAdapterMapping(mapping = {}) {
552
+ const problems = [];
553
+ if (mapping.schema_version !== 'osuite.runtime_adapter_mapping.v1') problems.push('schema_version must be osuite.runtime_adapter_mapping.v1');
554
+ if (!mapping.adapter_id) problems.push('adapter_id is required');
555
+ if (mapping.coverage_tier !== 'enterprise_custom') problems.push('coverage_tier must be enterprise_custom');
556
+ if (!mapping.field_map || typeof mapping.field_map !== 'object') problems.push('field_map is required');
557
+
558
+ const required = mapping.validation?.required_fields || [
559
+ 'actor',
560
+ 'operation',
561
+ 'target',
562
+ 'systems_touched',
563
+ 'data_boundary',
564
+ 'authority_boundary',
565
+ 'reversible',
566
+ ];
567
+
568
+ required.forEach((field) => {
569
+ if (!mapping.field_map?.[field]) problems.push(`field_map.${field} is required`);
570
+ });
571
+
572
+ if (!mapping.sample_event || typeof mapping.sample_event !== 'object') problems.push('sample_event is required');
573
+ return { ok: problems.length === 0, problems, required };
574
+ }
575
+
576
+ function printEnterpriseAdapterValidation(mapping, filePath) {
577
+ const validation = validateEnterpriseAdapterMapping(mapping);
578
+ write(c('Enterprise custom adapter', `${ANSI.bold}${ANSI.cyan}`));
579
+ write(c('Local CAVA mapping check. No server call was made.', ANSI.dim));
580
+ write('');
581
+ write(`File ${filePath}`);
582
+ write(`Adapter ${mapping.adapter_id || 'missing'}`);
583
+ write(`coverage_tier ${mapping.coverage_tier || 'missing'}`);
584
+ write(`parser_posture ${mapping.parser_posture || 'missing'}`);
585
+ write(`support_model ${mapping.support_model || 'missing'}`);
586
+ write('');
587
+
588
+ if (!validation.ok) {
589
+ write(c('Mapping problems', ANSI.red));
590
+ validation.problems.forEach((problem) => write(` - ${problem}`));
591
+ return validation;
592
+ }
593
+
594
+ write(c('adapter mapping looks usable', ANSI.green));
595
+ write('Required CAVA fields are mapped:');
596
+ validation.required.forEach((field) => write(` - ${field} <- ${mapping.field_map[field]}`));
597
+ write('');
598
+ write(c('Next step', ANSI.bold));
599
+ write(' Review the mapping with the runtime owner, then open Studio > Runtime Security > Runtime Coverage to register it.');
600
+ return validation;
601
+ }
602
+
603
+ function enterpriseAdapter(args = {}) {
604
+ const subcommand = args._[0] || 'help';
605
+
606
+ if (subcommand === 'init') {
607
+ const adapterId = slugifyAdapterName(args._[1] || args.name || 'enterprise-runtime');
608
+ const relativePath = `.osuite/adapters/${adapterId}.json`;
609
+ const template = enterpriseAdapterTemplate(adapterId);
610
+ const result = writeProjectFile(relativePath, `${JSON.stringify(template, null, 2)}\n`, { force: Boolean(args.force) });
611
+
612
+ write(c('Enterprise custom adapter', `${ANSI.bold}${ANSI.cyan}`));
613
+ write(c('Scaffolded a private-runtime mapping for CAVA Runtime Coverage.', ANSI.dim));
614
+ write('');
615
+ write(`${result.status === 'written' ? c('created', ANSI.green) : c('kept ', ANSI.yellow)} ${relativePath}`);
616
+ write('');
617
+ write(c('Next steps', ANSI.bold));
618
+ write(` 1. Edit ${relativePath} so field_map points at your real runtime event fields.`);
619
+ write(` 2. Run osuite adapter test ${relativePath}.`);
620
+ write(' 3. Register the validated mapping in Studio > Runtime Security > Runtime Coverage.');
621
+ return;
622
+ }
623
+
624
+ if (subcommand === 'test') {
625
+ const filePath = args._[1] || '.osuite/adapters/enterprise-runtime.json';
626
+ const mapping = readProjectJsonFile(filePath);
627
+ const validation = printEnterpriseAdapterValidation(mapping, filePath);
628
+ if (!validation.ok) process.exit(1);
629
+ return;
630
+ }
631
+
632
+ if (subcommand === 'deploy') {
633
+ const filePath = args._[1] || '.osuite/adapters/enterprise-runtime.json';
634
+ const mapping = readProjectJsonFile(filePath);
635
+ const validation = printEnterpriseAdapterValidation(mapping, filePath);
636
+ if (!validation.ok) process.exit(1);
637
+
638
+ const config = readConfig();
639
+ write(c('Deploy status', ANSI.bold));
640
+ if (!config.baseUrl || !config.apiKey) {
641
+ write(' validated locally; no Studio credentials were found.');
642
+ write(' Connect OSuite before deploy: osuite connect auto');
643
+ return;
644
+ }
645
+
646
+ write(` validated locally; open ${normalizedBaseUrl(config.baseUrl)}/runtime-security to finish registration.`);
647
+ write(' Studio stores enterprise mappings with workspace policy, versioning, and review ownership.');
648
+ return;
649
+ }
650
+
651
+ write(c('Enterprise custom adapter', `${ANSI.bold}${ANSI.cyan}`));
652
+ write('Usage:');
653
+ write(' osuite adapter init <name>');
654
+ write(' osuite adapter test <file>');
655
+ write(' osuite adapter deploy <file>');
656
+ }
657
+
422
658
  function tokenize(command) {
423
659
  return String(command || '').match(/"[^"]*"|'[^']*'|\S+/g)?.map((token) => token.replace(/^['"]|['"]$/g, '')) || [];
424
660
  }
@@ -1053,6 +1289,8 @@ async function main() {
1053
1289
  if (command === 'review') return review(args._[0]);
1054
1290
  if (command === 'approve') return decide(args._[0], 'allow', args);
1055
1291
  if (command === 'deny') return decide(args._[0], 'deny', args);
1292
+ if (command === 'adapters' || command === 'coverage') return printRuntimeCoverage(args);
1293
+ if (command === 'adapter') return enterpriseAdapter(args);
1056
1294
  if (command === 'external') return external(args);
1057
1295
  if (command === 'connect') return connect(args._[0] || 'auto', args);
1058
1296
  if (command === 'init') return init(args._[0] || 'generic', args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osuite",
3
- "version": "2.9.7",
3
+ "version": "2.9.9",
4
4
  "description": "OSuite governed action SDK for AI agents. Approve, replay, prove, and verify runtime decisions.",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -37,6 +37,15 @@
37
37
  "guardrails",
38
38
  "osuite"
39
39
  ],
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/OndCo/osuite.git",
43
+ "directory": "sdk"
44
+ },
45
+ "homepage": "https://ond.cc",
46
+ "bugs": {
47
+ "url": "https://github.com/OndCo/osuite/issues"
48
+ },
40
49
  "author": "OSuite",
41
50
  "license": "MIT",
42
51
  "engines": {