@vorionsys/sdk 0.1.0 → 0.1.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@vorionsys/sdk` will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.2] - 2026-02-17
9
+
10
+ ### Changed
11
+ - Removed raw `src` from published tarball (dist-only)
12
+ - Standardized package metadata for npm publish
13
+
14
+ ## [0.1.1] - 2026-02-11
15
+
16
+ ### Fixed
17
+
18
+ - Corrected default observation tier assignment during agent registration
19
+ - Improved error messages for missing capabilities in local mode
20
+
21
+ ## [0.1.0] - 2026-02-08
22
+
23
+ ### Added
24
+
25
+ - Initial release of `@vorionsys/sdk`
26
+ - `Vorion` client class with local and remote mode support
27
+ - `Agent` class with governance request lifecycle (register, request, report)
28
+ - `createVorion()` factory function
29
+ - Local mode with in-memory trust scoring and capability-based authorization
30
+ - Remote mode connecting to Cognigate API (`/api/v1/intents`, `/api/v1/trust`)
31
+ - Trust tier system (T0-T7) with asymmetric score adjustments
32
+ - Constraint application based on trust tier (rate limits, audit levels, sandboxing)
33
+ - Proof commitment IDs on every action decision for audit compliance
34
+ - Action history tracking per agent
35
+ - Health check endpoint support
36
+ - Full TypeScript type definitions (`VorionConfig`, `AgentOptions`, `ActionResult`, `TrustInfo`)
37
+ - Re-exported runtime types (`TrustTier`, `DecisionTier`, `AgentCredentials`, `Action`, `TrustSignal`)
38
+
39
+ [0.1.1]: https://github.com/vorionsys/vorion/compare/@vorionsys/sdk@0.1.0...@vorionsys/sdk@0.1.1
40
+ [0.1.0]: https://github.com/vorionsys/vorion/releases/tag/@vorionsys/sdk@0.1.0
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Vorion
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,345 @@
1
+ # @vorionsys/sdk
2
+
3
+ Simple, developer-friendly SDK for AI agent governance powered by the Vorion platform and the BASIS (Baseline Authority for Safe & Interoperable Systems) framework.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@vorionsys/sdk.svg)](https://www.npmjs.com/package/@vorionsys/sdk)
6
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @vorionsys/sdk
12
+ ```
13
+
14
+ The SDK requires `@vorionsys/runtime` as a peer dependency:
15
+
16
+ ```bash
17
+ npm install @vorionsys/sdk @vorionsys/runtime
18
+ ```
19
+
20
+ ## What It Provides
21
+
22
+ `@vorionsys/sdk` provides a simple interface for AI agent governance. It lets you:
23
+
24
+ - **Register agents** with declared capabilities and observation tiers
25
+ - **Submit governance requests** to check whether an agent is permitted to perform an action
26
+ - **Report outcomes** (success or failure) that dynamically adjust an agent's trust score
27
+ - **Query trust scores** to understand an agent's current standing in the trust tier system
28
+
29
+ The SDK operates in two modes: **local mode** for development and testing (in-memory, no external dependencies) and **remote mode** for production (connects to a Cognigate API instance).
30
+
31
+ ## Quick Start
32
+
33
+ ```typescript
34
+ import { Vorion } from '@vorionsys/sdk';
35
+
36
+ // Local mode -- in-memory governance for development and testing
37
+ const vorion = new Vorion({ localMode: true });
38
+
39
+ // 1. Register an agent with its capabilities
40
+ const agent = await vorion.registerAgent({
41
+ agentId: 'research-assistant',
42
+ name: 'Research Assistant',
43
+ capabilities: ['read:*', 'write:documents'],
44
+ });
45
+
46
+ // 2. Request permission before performing an action
47
+ const result = await agent.requestAction({
48
+ type: 'read',
49
+ resource: 'documents/quarterly-report.pdf',
50
+ });
51
+
52
+ if (result.allowed) {
53
+ // Action is permitted -- perform it
54
+ console.log('Proof ID:', result.proofId); // audit trail
55
+ console.log('Constraints:', result.constraints); // e.g. ['rate_limit:100/min']
56
+
57
+ // 3. Report the outcome to update trust
58
+ await agent.reportSuccess('read');
59
+ } else {
60
+ console.log('Denied:', result.reason);
61
+ }
62
+
63
+ // 4. Check the agent's current trust score
64
+ const trust = await agent.getTrustInfo();
65
+ console.log(`Trust: ${trust.score}/1000 (${trust.tierName})`);
66
+ ```
67
+
68
+ ## Usage Examples
69
+
70
+ ### Registering an Agent
71
+
72
+ ```typescript
73
+ import { Vorion } from '@vorionsys/sdk';
74
+
75
+ const vorion = new Vorion({ localMode: true });
76
+
77
+ const agent = await vorion.registerAgent({
78
+ agentId: 'data-analyst-01',
79
+ name: 'Data Analyst',
80
+ capabilities: ['read:*', 'write:reports', 'execute:queries'],
81
+ observationTier: 'GRAY_BOX', // BLACK_BOX | GRAY_BOX | WHITE_BOX
82
+ metadata: { version: '2.1', team: 'analytics' },
83
+ });
84
+
85
+ console.log(agent.getId()); // 'data-analyst-01'
86
+ console.log(agent.getName()); // 'Data Analyst'
87
+ console.log(agent.getCapabilities()); // ['read:*', 'write:reports', 'execute:queries']
88
+ ```
89
+
90
+ ### Submitting a Governance Request
91
+
92
+ Every action an agent wants to perform goes through the governance pipeline. The SDK checks capabilities and trust score, then returns a decision with an audit-grade proof ID.
93
+
94
+ ```typescript
95
+ const result = await agent.requestAction({
96
+ type: 'write',
97
+ resource: 'reports/summary.md',
98
+ parameters: { format: 'markdown', overwrite: false },
99
+ });
100
+
101
+ // result structure:
102
+ // {
103
+ // allowed: true,
104
+ // tier: 'GREEN', // GREEN = approved, YELLOW = conditional, RED = denied
105
+ // reason: 'Action permitted',
106
+ // proofId: 'a1b2c3d4-...', // unique proof commitment ID for audit
107
+ // constraints: ['rate_limit:100/min', 'audit:standard'],
108
+ // }
109
+ ```
110
+
111
+ ### Checking Trust Scores
112
+
113
+ Trust scores range from 0 to 1000. Agents start at 500 (T3 -- Monitored) and move up or down based on reported outcomes. Trust adjustment is asymmetric: failures cost more than successes gain.
114
+
115
+ ```typescript
116
+ const trust = await agent.getTrustInfo();
117
+ console.log(trust.score); // 500
118
+ console.log(trust.tierName); // 'Monitored'
119
+ console.log(trust.tierNumber); // 3
120
+ console.log(trust.observationTier); // 'GRAY_BOX'
121
+
122
+ // Report successes to build trust
123
+ await agent.reportSuccess('read');
124
+ await agent.reportSuccess('read');
125
+
126
+ const updated = await agent.getTrustInfo();
127
+ console.log(updated.score); // 504 (each success adds +2)
128
+
129
+ // Failures decrease trust more aggressively
130
+ await agent.reportFailure('write', 'Upstream permission denied');
131
+
132
+ const afterFailure = await agent.getTrustInfo();
133
+ console.log(afterFailure.score); // 484 (failure subtracts -20)
134
+ ```
135
+
136
+ ### Using the Factory Function
137
+
138
+ ```typescript
139
+ import { createVorion } from '@vorionsys/sdk';
140
+
141
+ const vorion = createVorion({ localMode: true });
142
+ ```
143
+
144
+ ### Remote Mode (Production)
145
+
146
+ Connect to a Cognigate API instance for production-grade governance with persistent trust state, distributed coordination, and full audit logging.
147
+
148
+ ```typescript
149
+ const vorion = new Vorion({
150
+ apiEndpoint: 'https://cognigate.example.com',
151
+ apiKey: process.env.VORION_API_KEY,
152
+ timeout: 15000, // request timeout in ms (default: 30000)
153
+ });
154
+
155
+ // API works identically -- the SDK handles remote calls transparently
156
+ const agent = await vorion.registerAgent({
157
+ agentId: 'prod-agent',
158
+ name: 'Production Agent',
159
+ capabilities: ['read:*'],
160
+ });
161
+
162
+ const result = await agent.requestAction({
163
+ type: 'read',
164
+ resource: 'data/users.json',
165
+ });
166
+
167
+ // Remote mode includes server-side processing time
168
+ console.log(result.processingTimeMs); // e.g. 12
169
+ ```
170
+
171
+ ### Health Check
172
+
173
+ ```typescript
174
+ const health = await vorion.healthCheck();
175
+ // Local: { status: 'healthy', version: 'local' }
176
+ // Remote: { status: 'healthy', version: '1.2.0' }
177
+ ```
178
+
179
+ ### Managing Multiple Agents
180
+
181
+ ```typescript
182
+ const vorion = new Vorion({ localMode: true });
183
+
184
+ await vorion.registerAgent({ agentId: 'agent-a', name: 'Agent A', capabilities: ['read:*'] });
185
+ await vorion.registerAgent({ agentId: 'agent-b', name: 'Agent B', capabilities: ['write:*'] });
186
+
187
+ const agentA = vorion.getAgent('agent-a'); // Agent | undefined
188
+ const all = vorion.getAllAgents(); // Agent[]
189
+ console.log(all.length); // 2
190
+ console.log(vorion.isLocalMode()); // true
191
+ ```
192
+
193
+ ## API Reference
194
+
195
+ ### Exports
196
+
197
+ | Export | Type | Description |
198
+ |--------|------|-------------|
199
+ | `Vorion` | Class | Main SDK client for agent governance |
200
+ | `Agent` | Class | Agent wrapper returned by `registerAgent()` |
201
+ | `createVorion` | Function | Factory function to create a `Vorion` instance |
202
+ | `VorionConfig` | Interface | Configuration options for `Vorion` |
203
+ | `AgentOptions` | Interface | Options for registering an agent |
204
+ | `ActionResult` | Interface | Result returned by `requestAction()` |
205
+ | `TrustInfo` | Interface | Trust score information from `getTrustInfo()` |
206
+ | `TrustTier` | Type | Re-exported from `@vorionsys/runtime` |
207
+ | `DecisionTier` | Type | Re-exported from `@vorionsys/runtime` |
208
+ | `AgentCredentials` | Type | Re-exported from `@vorionsys/runtime` |
209
+ | `Action` | Type | Re-exported from `@vorionsys/runtime` |
210
+ | `TrustSignal` | Type | Re-exported from `@vorionsys/runtime` |
211
+
212
+ ### `Vorion` Class
213
+
214
+ ```typescript
215
+ new Vorion(config?: VorionConfig)
216
+ ```
217
+
218
+ **Config options:**
219
+
220
+ | Property | Type | Default | Description |
221
+ |----------|------|---------|-------------|
222
+ | `apiEndpoint` | `string` | -- | Cognigate API URL. Enables remote mode when set. |
223
+ | `apiKey` | `string` | -- | API key. Required when `apiEndpoint` is set. |
224
+ | `localMode` | `boolean` | `true` | Force local (in-memory) mode. Defaults to `true` when no endpoint is provided. |
225
+ | `defaultObservationTier` | `'BLACK_BOX' \| 'GRAY_BOX' \| 'WHITE_BOX'` | `'GRAY_BOX'` | Default observation tier for registered agents. |
226
+ | `timeout` | `number` | `30000` | Request timeout in milliseconds (remote mode). |
227
+
228
+ **Methods:**
229
+
230
+ | Method | Returns | Description |
231
+ |--------|---------|-------------|
232
+ | `registerAgent(options)` | `Promise<Agent>` | Register an agent with the governance system |
233
+ | `getAgent(agentId)` | `Agent \| undefined` | Retrieve a registered agent by ID |
234
+ | `getAllAgents()` | `Agent[]` | List all registered agents |
235
+ | `getConfig()` | `VorionConfig` | Get the current SDK configuration |
236
+ | `isLocalMode()` | `boolean` | Check if the SDK is running in local mode |
237
+ | `healthCheck()` | `Promise<{ status, version }>` | Check API health (returns local status in local mode) |
238
+
239
+ ### `Agent` Class
240
+
241
+ Returned by `vorion.registerAgent()`. Do not instantiate directly.
242
+
243
+ **Methods:**
244
+
245
+ | Method | Returns | Description |
246
+ |--------|---------|-------------|
247
+ | `requestAction(action)` | `Promise<ActionResult>` | Request permission to perform an action |
248
+ | `reportSuccess(actionType)` | `Promise<void>` | Report a successful action (positive trust signal, +2 score in local mode) |
249
+ | `reportFailure(actionType, reason?)` | `Promise<void>` | Report a failed action (negative trust signal, -20 score in local mode) |
250
+ | `getTrustInfo()` | `Promise<TrustInfo>` | Get current trust score and tier information |
251
+ | `getId()` | `string` | Get the agent's unique identifier |
252
+ | `getName()` | `string` | Get the agent's human-readable name |
253
+ | `getCapabilities()` | `string[]` | Get the agent's declared capabilities |
254
+ | `getActionHistory()` | `Array<{ action, allowed, timestamp }>` | Get the agent's action request history |
255
+
256
+ ### `ActionResult` Interface
257
+
258
+ ```typescript
259
+ interface ActionResult {
260
+ allowed: boolean; // Whether the action was permitted
261
+ tier: 'GREEN' | 'YELLOW' | 'RED'; // Decision tier
262
+ reason: string; // Human-readable explanation
263
+ proofId: string; // Unique proof commitment ID for audit
264
+ constraints?: string[]; // Applied constraints (e.g. rate limits)
265
+ processingTimeMs?: number; // Server processing time (remote mode only)
266
+ }
267
+ ```
268
+
269
+ ### `TrustInfo` Interface
270
+
271
+ ```typescript
272
+ interface TrustInfo {
273
+ score: number; // Current trust score (0-1000)
274
+ tierName: string; // Human-readable tier name (e.g. 'Monitored')
275
+ tierNumber: number; // Tier number (0-7)
276
+ observationTier: string; // Observation tier (BLACK_BOX, GRAY_BOX, WHITE_BOX)
277
+ }
278
+ ```
279
+
280
+ ## Trust Tiers
281
+
282
+ Agents start at T3 (Monitored, score 500) in local mode. Trust adjusts asymmetrically based on reported signals -- successes increase score gradually while failures decrease it more aggressively.
283
+
284
+ | Tier | Score Range | Name | Constraints |
285
+ |------|-------------|------|-------------|
286
+ | T0 | 0--199 | Sandbox | `rate_limit:10/min`, `audit:full`, `sandbox:true` |
287
+ | T1 | 200--349 | Observed | `rate_limit:10/min`, `audit:full`, `sandbox:true` |
288
+ | T2 | 350--499 | Provisional | `rate_limit:100/min`, `audit:standard` |
289
+ | T3 | 500--649 | Monitored | `rate_limit:100/min`, `audit:standard` |
290
+ | T4 | 650--799 | Standard | `rate_limit:1000/min`, `audit:light` |
291
+ | T5 | 800--875 | Trusted | `rate_limit:1000/min`, `audit:light` |
292
+ | T6 | 876--950 | Certified | No constraints |
293
+ | T7 | 951--1000 | Autonomous | No constraints |
294
+
295
+ ## Capability Patterns
296
+
297
+ Capabilities use a `type:resource` pattern with glob support:
298
+
299
+ | Pattern | Matches |
300
+ |---------|---------|
301
+ | `read` | Exact match on `read` action type |
302
+ | `read:*` | Any `read` action regardless of resource |
303
+ | `read:documents` | `read` actions on resources starting with `documents/` |
304
+ | `*` | All actions (unrestricted) |
305
+
306
+ ## TypeScript
307
+
308
+ The SDK ships with full TypeScript type definitions. All interfaces and types are exported for direct use:
309
+
310
+ ```typescript
311
+ import type {
312
+ VorionConfig,
313
+ AgentOptions,
314
+ ActionResult,
315
+ TrustInfo,
316
+ TrustTier,
317
+ DecisionTier,
318
+ AgentCredentials,
319
+ Action,
320
+ TrustSignal,
321
+ } from '@vorionsys/sdk';
322
+ ```
323
+
324
+ ## Requirements
325
+
326
+ - Node.js >= 18.0.0
327
+ - `@vorionsys/runtime` >= 0.1.0 (peer dependency)
328
+
329
+ ## Related Packages
330
+
331
+ | Package | Description |
332
+ |---------|-------------|
333
+ | [`@vorionsys/runtime`](https://www.npmjs.com/package/@vorionsys/runtime) | Core orchestration layer (trust facade, proof committer, intent pipeline) |
334
+
335
+ ## Contributing
336
+
337
+ See the [main repository](https://github.com/vorionsys/vorion) for contribution guidelines.
338
+
339
+ ## License
340
+
341
+ Apache-2.0 -- see [LICENSE](./LICENSE) for details.
342
+
343
+ ---
344
+
345
+ Part of the [Vorion](https://github.com/vorionsys/vorion) project.
package/dist/index.d.ts CHANGED
@@ -92,7 +92,7 @@ declare class ApiClient {
92
92
  tier: string;
93
93
  reason: string;
94
94
  proofId: string;
95
- constraints?: string[] | undefined;
95
+ constraints?: string[];
96
96
  processingTimeMs: number;
97
97
  }>;
98
98
  checkIntent(payload: {
@@ -121,15 +121,15 @@ declare class ApiClient {
121
121
  observationCeiling: number;
122
122
  capabilities: string[];
123
123
  expiresAt: string;
124
- reason?: string | undefined;
124
+ reason?: string;
125
125
  }>;
126
126
  getTrustInfo(agentId: string): Promise<{
127
127
  agentId: string;
128
128
  score: number | null;
129
129
  tier: number | null;
130
130
  tierName: string | null;
131
- observationCeiling?: number | undefined;
132
- message?: string | undefined;
131
+ observationCeiling?: number;
132
+ message?: string;
133
133
  }>;
134
134
  recordSignal(agentId: string, payload: {
135
135
  type: 'success' | 'failure' | 'violation' | 'neutral';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,YAAY,EACV,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,sBAAsB,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;IAChE,gGAAgG;IAChG,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,IAAI,EAAE,MAA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