@nomosprotocol/sdk 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/dist/errors.d.ts +31 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +54 -0
- package/dist/errors.js.map +1 -0
- package/dist/http-client.d.ts +14 -0
- package/dist/http-client.d.ts.map +1 -0
- package/dist/http-client.js +70 -0
- package/dist/http-client.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/nomos.d.ts +13 -0
- package/dist/nomos.d.ts.map +1 -0
- package/dist/nomos.js +26 -0
- package/dist/nomos.js.map +1 -0
- package/dist/resources/artifacts.d.ts +22 -0
- package/dist/resources/artifacts.d.ts.map +1 -0
- package/dist/resources/artifacts.js +46 -0
- package/dist/resources/artifacts.js.map +1 -0
- package/dist/resources/decisions.d.ts +24 -0
- package/dist/resources/decisions.d.ts.map +1 -0
- package/dist/resources/decisions.js +53 -0
- package/dist/resources/decisions.js.map +1 -0
- package/dist/resources/governance.d.ts +30 -0
- package/dist/resources/governance.d.ts.map +1 -0
- package/dist/resources/governance.js +33 -0
- package/dist/resources/governance.js.map +1 -0
- package/dist/types.d.ts +117 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +4 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +11 -0
- package/dist/util.js.map +1 -0
- package/package.json +40 -0
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type NomosErrorCode = 'authentication_error' | 'authorization_error' | 'rate_limit_error' | 'validation_error' | 'not_found' | 'api_error' | 'network_error';
|
|
2
|
+
export declare class NomosError extends Error {
|
|
3
|
+
readonly code: NomosErrorCode;
|
|
4
|
+
readonly status?: number;
|
|
5
|
+
readonly requestId?: string;
|
|
6
|
+
constructor(message: string, code: NomosErrorCode, status?: number, requestId?: string);
|
|
7
|
+
}
|
|
8
|
+
export declare class NomosAuthenticationError extends NomosError {
|
|
9
|
+
constructor(message?: string, requestId?: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class NomosAuthorizationError extends NomosError {
|
|
12
|
+
constructor(message?: string, requestId?: string);
|
|
13
|
+
}
|
|
14
|
+
export declare class NomosRateLimitError extends NomosError {
|
|
15
|
+
readonly retryAfter?: number;
|
|
16
|
+
constructor(message?: string, retryAfter?: number, requestId?: string);
|
|
17
|
+
}
|
|
18
|
+
export declare class NomosValidationError extends NomosError {
|
|
19
|
+
readonly details?: unknown;
|
|
20
|
+
constructor(message: string, details?: unknown, requestId?: string);
|
|
21
|
+
}
|
|
22
|
+
export declare class NomosNotFoundError extends NomosError {
|
|
23
|
+
constructor(message: string, requestId?: string);
|
|
24
|
+
}
|
|
25
|
+
export declare class NomosAPIError extends NomosError {
|
|
26
|
+
constructor(message: string, status: number, requestId?: string);
|
|
27
|
+
}
|
|
28
|
+
export declare class NomosNetworkError extends NomosError {
|
|
29
|
+
constructor(message: string);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GACtB,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,GAClB,kBAAkB,GAClB,WAAW,GACX,WAAW,GACX,eAAe,CAAC;AAEpB,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;gBAEhB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;CAOvF;AAED,qBAAa,wBAAyB,SAAQ,UAAU;gBAC1C,OAAO,SAAoB,EAAE,SAAS,CAAC,EAAE,MAAM;CAI5D;AAED,qBAAa,uBAAwB,SAAQ,UAAU;gBACzC,OAAO,SAAkB,EAAE,SAAS,CAAC,EAAE,MAAM;CAI1D;AAED,qBAAa,mBAAoB,SAAQ,UAAU;IACjD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;gBAEjB,OAAO,SAAwB,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;CAKrF;AAED,qBAAa,oBAAqB,SAAQ,UAAU;IAClD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;gBAEf,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM;CAKnE;AAED,qBAAa,kBAAmB,SAAQ,UAAU;gBACpC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;CAIhD;AAED,qBAAa,aAAc,SAAQ,UAAU;gBAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;CAIhE;AAED,qBAAa,iBAAkB,SAAQ,UAAU;gBACnC,OAAO,EAAE,MAAM;CAI5B"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export class NomosError extends Error {
|
|
2
|
+
constructor(message, code, status, requestId) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = 'NomosError';
|
|
5
|
+
this.code = code;
|
|
6
|
+
this.status = status;
|
|
7
|
+
this.requestId = requestId;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export class NomosAuthenticationError extends NomosError {
|
|
11
|
+
constructor(message = 'Invalid API key', requestId) {
|
|
12
|
+
super(message, 'authentication_error', 401, requestId);
|
|
13
|
+
this.name = 'NomosAuthenticationError';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export class NomosAuthorizationError extends NomosError {
|
|
17
|
+
constructor(message = 'Access denied', requestId) {
|
|
18
|
+
super(message, 'authorization_error', 403, requestId);
|
|
19
|
+
this.name = 'NomosAuthorizationError';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export class NomosRateLimitError extends NomosError {
|
|
23
|
+
constructor(message = 'Rate limit exceeded', retryAfter, requestId) {
|
|
24
|
+
super(message, 'rate_limit_error', 429, requestId);
|
|
25
|
+
this.name = 'NomosRateLimitError';
|
|
26
|
+
this.retryAfter = retryAfter;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export class NomosValidationError extends NomosError {
|
|
30
|
+
constructor(message, details, requestId) {
|
|
31
|
+
super(message, 'validation_error', 400, requestId);
|
|
32
|
+
this.name = 'NomosValidationError';
|
|
33
|
+
this.details = details;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class NomosNotFoundError extends NomosError {
|
|
37
|
+
constructor(message, requestId) {
|
|
38
|
+
super(message, 'not_found', 404, requestId);
|
|
39
|
+
this.name = 'NomosNotFoundError';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export class NomosAPIError extends NomosError {
|
|
43
|
+
constructor(message, status, requestId) {
|
|
44
|
+
super(message, 'api_error', status, requestId);
|
|
45
|
+
this.name = 'NomosAPIError';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export class NomosNetworkError extends NomosError {
|
|
49
|
+
constructor(message) {
|
|
50
|
+
super(message, 'network_error');
|
|
51
|
+
this.name = 'NomosNetworkError';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,UAAW,SAAQ,KAAK;IAKnC,YAAY,OAAe,EAAE,IAAoB,EAA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OAAO,kBAAmB,SAAQ,UAAU;IAChD,YAAY,OAAe,EAAE,SAAkB;QAC7C,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED,MAAM,OAAO,aAAc,SAAQ,UAAU;IAC3C,YAAY,OAAe,EAAE,MAAc,EAAE,SAAkB;QAC7D,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QAC/C,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAC/C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface HttpClientOptions {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
maxRetries: number;
|
|
5
|
+
timeout: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class HttpClient {
|
|
8
|
+
private readonly opts;
|
|
9
|
+
constructor(opts: HttpClientOptions);
|
|
10
|
+
get<T>(path: string): Promise<T>;
|
|
11
|
+
post<T>(path: string, body: unknown): Promise<T>;
|
|
12
|
+
private request;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=http-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,iBAAiB;IAE9C,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;YAIxC,OAAO;CA6DtB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { NomosAuthenticationError, NomosAuthorizationError, NomosRateLimitError, NomosValidationError, NomosNotFoundError, NomosAPIError, NomosNetworkError, } from './errors.js';
|
|
2
|
+
import { sleep, jitteredBackoff, isRetryable } from './util.js';
|
|
3
|
+
export class HttpClient {
|
|
4
|
+
constructor(opts) {
|
|
5
|
+
this.opts = opts;
|
|
6
|
+
}
|
|
7
|
+
async get(path) {
|
|
8
|
+
return this.request('GET', path, undefined);
|
|
9
|
+
}
|
|
10
|
+
async post(path, body) {
|
|
11
|
+
return this.request('POST', path, body);
|
|
12
|
+
}
|
|
13
|
+
async request(method, path, body, attempt = 0) {
|
|
14
|
+
const url = `${this.opts.baseUrl}${path}`;
|
|
15
|
+
const controller = new AbortController();
|
|
16
|
+
const timer = setTimeout(() => controller.abort(), this.opts.timeout);
|
|
17
|
+
let res;
|
|
18
|
+
try {
|
|
19
|
+
res = await fetch(url, {
|
|
20
|
+
method,
|
|
21
|
+
signal: controller.signal,
|
|
22
|
+
headers: {
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
'X-Nomos-Api-Key': this.opts.apiKey,
|
|
25
|
+
'User-Agent': 'nomos-sdk/1.0.0',
|
|
26
|
+
},
|
|
27
|
+
body: body != null ? JSON.stringify(body) : undefined,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
clearTimeout(timer);
|
|
32
|
+
if (err.name === 'AbortError') {
|
|
33
|
+
throw new NomosNetworkError(`Request timed out after ${this.opts.timeout}ms`);
|
|
34
|
+
}
|
|
35
|
+
throw new NomosNetworkError(err.message ?? 'Network error');
|
|
36
|
+
}
|
|
37
|
+
finally {
|
|
38
|
+
clearTimeout(timer);
|
|
39
|
+
}
|
|
40
|
+
const requestId = res.headers.get('x-request-id') ?? undefined;
|
|
41
|
+
if (res.ok) {
|
|
42
|
+
return res.json();
|
|
43
|
+
}
|
|
44
|
+
// Retry on 429 / 5xx
|
|
45
|
+
if (isRetryable(res.status) && attempt < this.opts.maxRetries) {
|
|
46
|
+
const retryAfter = res.headers.get('retry-after');
|
|
47
|
+
const delay = retryAfter
|
|
48
|
+
? parseInt(retryAfter, 10) * 1000
|
|
49
|
+
: jitteredBackoff(attempt);
|
|
50
|
+
await sleep(delay);
|
|
51
|
+
return this.request(method, path, body, attempt + 1);
|
|
52
|
+
}
|
|
53
|
+
let errBody = {};
|
|
54
|
+
try {
|
|
55
|
+
errBody = await res.json();
|
|
56
|
+
}
|
|
57
|
+
catch { }
|
|
58
|
+
const message = errBody?.error ?? errBody?.message ?? res.statusText;
|
|
59
|
+
switch (res.status) {
|
|
60
|
+
case 401: throw new NomosAuthenticationError(message, requestId);
|
|
61
|
+
case 403: throw new NomosAuthorizationError(message, requestId);
|
|
62
|
+
case 404: throw new NomosNotFoundError(message, requestId);
|
|
63
|
+
case 422:
|
|
64
|
+
case 400: throw new NomosValidationError(message, errBody?.details, requestId);
|
|
65
|
+
case 429: throw new NomosRateLimitError(message, res.headers.get('retry-after') ? parseInt(res.headers.get('retry-after'), 10) : undefined, requestId);
|
|
66
|
+
default: throw new NomosAPIError(message, res.status, requestId);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=http-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.js","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB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,CAAA,CAAC;QAC5C,MAAM,OAAO,GAAW,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC;QAE7E,QAAQ,GAAG,CAAC,MAAM,EAAE,CAAC;YACnB,KAAK,GAAG,CAAC,CAAC,MAAM,IAAI,wBAAwB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YACjE,KAAK,GAAG,CAAC,CAAC,MAAM,IAAI,uBAAuB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAChE,KAAK,GAAG,CAAC,CAAC,MAAM,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAC3D,KAAK,GAAG,CAAC;YACT,KAAK,GAAG,CAAC,CAAC,MAAM,IAAI,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;YAC/E,KAAK,GAAG,CAAC,CAAC,MAAM,IAAI,mBAAmB,CACrC,OAAO,EACP,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,EAC1F,SAAS,CACV,CAAC;YACF,OAAO,CAAC,CAAE,MAAM,IAAI,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Nomos } from './nomos.js';
|
|
2
|
+
export * from './errors.js';
|
|
3
|
+
export type { NomosConfig, VerifyDecisionParams, VerifyDecisionResult, ListArtifactsParams, ArtifactList, Artifact, GenerateGovernanceParams, GenerateGovernanceResult, DetectContradictionsParams, DetectContradictionsResult, Contradiction, Verdict, } from './types.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,YAAY,EACV,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,aAAa,EACb,OAAO,GACR,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,cAAc,aAAa,CAAC"}
|
package/dist/nomos.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Decisions } from './resources/decisions.js';
|
|
2
|
+
import { Artifacts } from './resources/artifacts.js';
|
|
3
|
+
import { Governance } from './resources/governance.js';
|
|
4
|
+
import * as errors from './errors.js';
|
|
5
|
+
import type { NomosConfig } from './types.js';
|
|
6
|
+
export declare class Nomos {
|
|
7
|
+
readonly decisions: Decisions;
|
|
8
|
+
readonly artifacts: Artifacts;
|
|
9
|
+
readonly governance: Governance;
|
|
10
|
+
static readonly errors: typeof errors;
|
|
11
|
+
constructor(apiKey: string, config?: NomosConfig);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=nomos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nomos.d.ts","sourceRoot":"","sources":["../src/nomos.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAM9C,qBAAa,KAAK;IAChB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAEhC,MAAM,CAAC,QAAQ,CAAC,MAAM,gBAAU;gBAEpB,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,WAAgB;CAkBrD"}
|
package/dist/nomos.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HttpClient } from './http-client.js';
|
|
2
|
+
import { Decisions } from './resources/decisions.js';
|
|
3
|
+
import { Artifacts } from './resources/artifacts.js';
|
|
4
|
+
import { Governance } from './resources/governance.js';
|
|
5
|
+
import * as errors from './errors.js';
|
|
6
|
+
const DEFAULT_BASE_URL = 'https://nomos.ai';
|
|
7
|
+
const DEFAULT_MAX_RETRIES = 3;
|
|
8
|
+
const DEFAULT_TIMEOUT = 30000;
|
|
9
|
+
export class Nomos {
|
|
10
|
+
constructor(apiKey, config = {}) {
|
|
11
|
+
if (!apiKey || typeof apiKey !== 'string') {
|
|
12
|
+
throw new errors.NomosAuthenticationError('A valid API key is required. Pass it as the first argument: new Nomos("nms_live_...")');
|
|
13
|
+
}
|
|
14
|
+
const http = new HttpClient({
|
|
15
|
+
apiKey,
|
|
16
|
+
baseUrl: (config.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, ''),
|
|
17
|
+
maxRetries: config.maxRetries ?? DEFAULT_MAX_RETRIES,
|
|
18
|
+
timeout: config.timeout ?? DEFAULT_TIMEOUT,
|
|
19
|
+
});
|
|
20
|
+
this.decisions = new Decisions(http);
|
|
21
|
+
this.artifacts = new Artifacts(http);
|
|
22
|
+
this.governance = new Governance(http);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25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MAAM,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { HttpClient } from '../http-client.js';
|
|
2
|
+
import type { Artifact, ArtifactList, ListArtifactsParams } from '../types.js';
|
|
3
|
+
export declare class Artifacts {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Retrieve a single artifact by ID.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const artifact = await nomos.artifacts.retrieve('loan_approval_v1');
|
|
11
|
+
* console.log(artifact.ari_score, artifact.autonomy_band);
|
|
12
|
+
*/
|
|
13
|
+
retrieve(artifactId: string): Promise<Artifact>;
|
|
14
|
+
/**
|
|
15
|
+
* List published artifacts on the Exchange with optional filters.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const { data } = await nomos.artifacts.list({ band: 'autonomous', limit: 10 });
|
|
19
|
+
*/
|
|
20
|
+
list(params?: ListArtifactsParams): Promise<ArtifactList>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/resources/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE/E,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;OAMG;IACG,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIrD;;;;;OAKG;IACG,IAAI,CAAC,MAAM,GAAE,mBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC;CAkBpE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export class Artifacts {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Retrieve a single artifact by ID.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const artifact = await nomos.artifacts.retrieve('loan_approval_v1');
|
|
10
|
+
* console.log(artifact.ari_score, artifact.autonomy_band);
|
|
11
|
+
*/
|
|
12
|
+
async retrieve(artifactId) {
|
|
13
|
+
return this.http.get(`/api/exchange/artifacts/${encodeURIComponent(artifactId)}`);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* List published artifacts on the Exchange with optional filters.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const { data } = await nomos.artifacts.list({ band: 'autonomous', limit: 10 });
|
|
20
|
+
*/
|
|
21
|
+
async list(params = {}) {
|
|
22
|
+
const qs = new URLSearchParams();
|
|
23
|
+
if (params.band)
|
|
24
|
+
qs.set('band', params.band);
|
|
25
|
+
if (params.domain)
|
|
26
|
+
qs.set('domain', params.domain);
|
|
27
|
+
if (params.jurisdiction)
|
|
28
|
+
qs.set('jurisdiction', params.jurisdiction);
|
|
29
|
+
if (params.sort)
|
|
30
|
+
qs.set('sort', params.sort);
|
|
31
|
+
if (params.limit != null)
|
|
32
|
+
qs.set('limit', String(params.limit));
|
|
33
|
+
if (params.offset != null)
|
|
34
|
+
qs.set('offset', String(params.offset));
|
|
35
|
+
const query = qs.toString();
|
|
36
|
+
const raw = await this.http.get(`/api/exchange/artifacts${query ? `?${query}` : ''}`);
|
|
37
|
+
// API returns { artifacts: [], total: N } — normalise to { data: [], total: N }
|
|
38
|
+
return {
|
|
39
|
+
data: Array.isArray(raw) ? raw : (raw.artifacts ?? raw.data ?? []),
|
|
40
|
+
total: raw.total ?? (Array.isArray(raw) ? raw.length : 0),
|
|
41
|
+
limit: params.limit ?? 20,
|
|
42
|
+
offset: params.offset ?? 0,
|
|
43
|
+
};
|
|
44
|
+
}
|
|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QAAQ,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAM,0BAA0B,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3F,gFAAgF;QAChF,OAAO;YACL,IAAI,EAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;YACpE,KAAK,EAAG,GAAG,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1D,KAAK,EAAG,MAAM,CAAC,KAAK,IAAI,EAAE;YAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,CAAC;SAC3B,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HttpClient } from '../http-client.js';
|
|
2
|
+
import type { VerifyDecisionParams, VerifyDecisionResult } from '../types.js';
|
|
3
|
+
export declare class Decisions {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Verify whether an AI decision is permitted under a governance artifact.
|
|
8
|
+
*
|
|
9
|
+
* Public demo artifacts (pub_*) work without an API key.
|
|
10
|
+
* Custom artifacts require a valid API key.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const result = await nomos.decisions.verify({
|
|
14
|
+
* artifact_id: 'pub_lending_v1',
|
|
15
|
+
* decision_context: { credit_score: 720, loan_amount: 50000 },
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* if (!result.allowed) {
|
|
19
|
+
* throw new Error(`Decision blocked: ${result.verdict_description}`);
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
verify(params: VerifyDecisionParams): Promise<VerifyDecisionResult>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=decisions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../../src/resources/decisions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE9E,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;;;;;;;;;;OAeG;IACG,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAiC1E"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export class Decisions {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Verify whether an AI decision is permitted under a governance artifact.
|
|
7
|
+
*
|
|
8
|
+
* Public demo artifacts (pub_*) work without an API key.
|
|
9
|
+
* Custom artifacts require a valid API key.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const result = await nomos.decisions.verify({
|
|
13
|
+
* artifact_id: 'pub_lending_v1',
|
|
14
|
+
* decision_context: { credit_score: 720, loan_amount: 50000 },
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* if (!result.allowed) {
|
|
18
|
+
* throw new Error(`Decision blocked: ${result.verdict_description}`);
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
async verify(params) {
|
|
22
|
+
const { artifact_id, decision_context, proposed_decision, correlation_id } = params;
|
|
23
|
+
// Public artifacts (pub_*) use the open /verify endpoint — no API key required
|
|
24
|
+
const isPublic = artifact_id.startsWith('pub_');
|
|
25
|
+
let raw;
|
|
26
|
+
if (isPublic) {
|
|
27
|
+
raw = await this.http.post('/api/v1/verify', {
|
|
28
|
+
artifact_id,
|
|
29
|
+
decision: proposed_decision ?? 'evaluate',
|
|
30
|
+
inputs: decision_context,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
raw = await this.http.post('/api/v1/verify-decision', {
|
|
35
|
+
artifact_id,
|
|
36
|
+
decision_context,
|
|
37
|
+
proposed_decision,
|
|
38
|
+
correlation_id: correlation_id ?? crypto.randomUUID(),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
allowed: raw.allowed ?? false,
|
|
43
|
+
verdict: raw.outcome ?? raw.verdict ?? 'pending_human_review',
|
|
44
|
+
verdict_description: raw.verdict_description ?? '',
|
|
45
|
+
rule_reference: raw.rule_reference ?? raw.rule_applied,
|
|
46
|
+
audit_record: raw.audit_record ?? raw.audit_hash,
|
|
47
|
+
artifact_id: raw.artifact_id ?? artifact_id,
|
|
48
|
+
execution_id: raw.execution_id,
|
|
49
|
+
decided_at: raw.decided_at ?? raw.evaluated_at ?? new Date().toISOString(),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=decisions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decisions.js","sourceRoot":"","sources":["../../src/resources/decisions.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,SAAS;IACpB,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,MAAM,CAAC,MAA4B;QACvC,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;QAEpF,+EAA+E;QAC/E,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,GAAQ,CAAC;QAEb,IAAI,QAAQ,EAAE,CAAC;YACb,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAM,gBAAgB,EAAE;gBAChD,WAAW;gBACX,QAAQ,EAAE,iBAAiB,IAAI,UAAU;gBACzC,MAAM,EAAI,gBAAgB;aAC3B,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAM,yBAAyB,EAAE;gBACzD,WAAW;gBACX,gBAAgB;gBAChB,iBAAiB;gBACjB,cAAc,EAAE,cAAc,IAAI,MAAM,CAAC,UAAU,EAAE;aACtD,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,OAAO,EAAc,GAAG,CAAC,OAAO,IAAI,KAAK;YACzC,OAAO,EAAc,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,IAAI,sBAAsB;YACzE,mBAAmB,EAAE,GAAG,CAAC,mBAAmB,IAAI,EAAE;YAClD,cAAc,EAAO,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC,YAAY;YAC3D,YAAY,EAAS,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,UAAU;YACvD,WAAW,EAAU,GAAG,CAAC,WAAW,IAAI,WAAW;YACnD,YAAY,EAAS,GAAG,CAAC,YAAY;YACrC,UAAU,EAAW,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,YAAY,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { HttpClient } from '../http-client.js';
|
|
2
|
+
import type { GenerateGovernanceParams, GenerateGovernanceResult, DetectContradictionsParams, DetectContradictionsResult } from '../types.js';
|
|
3
|
+
export declare class Governance {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Generate a sealed .nomos governance artifact from policy documents
|
|
8
|
+
* and optional historical decision logs.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const artifact = await nomos.governance.generate({
|
|
12
|
+
* policies: [policyText],
|
|
13
|
+
* decision_logs: historicalRows,
|
|
14
|
+
* domain: 'loan_approval',
|
|
15
|
+
* });
|
|
16
|
+
* console.log(artifact.ari_score, artifact.seal_hash);
|
|
17
|
+
*/
|
|
18
|
+
generate(params: GenerateGovernanceParams): Promise<GenerateGovernanceResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Detect contradictions and conflicts in a rule set before sealing.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* const report = await nomos.governance.detectContradictions({ rules });
|
|
24
|
+
* if (!report.clean) {
|
|
25
|
+
* console.log(report.contradictions);
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
28
|
+
detectContradictions(params: DetectContradictionsParams): Promise<DetectContradictionsResult>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=governance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance.d.ts","sourceRoot":"","sources":["../../src/resources/governance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAErB,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;;;;;;OAWG;IACG,QAAQ,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAInF;;;;;;;;OAQG;IACG,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAGpG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export class Governance {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Generate a sealed .nomos governance artifact from policy documents
|
|
7
|
+
* and optional historical decision logs.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const artifact = await nomos.governance.generate({
|
|
11
|
+
* policies: [policyText],
|
|
12
|
+
* decision_logs: historicalRows,
|
|
13
|
+
* domain: 'loan_approval',
|
|
14
|
+
* });
|
|
15
|
+
* console.log(artifact.ari_score, artifact.seal_hash);
|
|
16
|
+
*/
|
|
17
|
+
async generate(params) {
|
|
18
|
+
return this.http.post('/api/v1/generate-governance', params);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Detect contradictions and conflicts in a rule set before sealing.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const report = await nomos.governance.detectContradictions({ rules });
|
|
25
|
+
* if (!report.clean) {
|
|
26
|
+
* console.log(report.contradictions);
|
|
27
|
+
* }
|
|
28
|
+
*/
|
|
29
|
+
async detectContradictions(params) {
|
|
30
|
+
return this.http.post('/api/v1/detect-contradictions', params);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=governance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance.js","sourceRoot":"","sources":["../../src/resources/governance.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,UAAU;IACrB,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,QAAQ,CAAC,MAAgC;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAA2B,6BAA6B,EAAE,MAAM,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,oBAAoB,CAAC,MAAkC;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAA6B,+BAA+B,EAAE,MAAM,CAAC,CAAC;IAC7F,CAAC;CACF"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export interface VerifyDecisionParams {
|
|
2
|
+
/** Artifact ID from NOMOS Studio or the Exchange */
|
|
3
|
+
artifact_id: string;
|
|
4
|
+
/** The data fields this decision is based on */
|
|
5
|
+
decision_context: Record<string, unknown>;
|
|
6
|
+
/** Optional: the AI's proposed decision (for audit trail) */
|
|
7
|
+
proposed_decision?: string;
|
|
8
|
+
/** Optional: unique ID for idempotency */
|
|
9
|
+
correlation_id?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ListArtifactsParams {
|
|
12
|
+
/** Filter by autonomy band */
|
|
13
|
+
band?: 'autonomous' | 'bounded' | 'human_governed';
|
|
14
|
+
/** Filter by domain */
|
|
15
|
+
domain?: string;
|
|
16
|
+
/** Filter by jurisdiction tag */
|
|
17
|
+
jurisdiction?: string;
|
|
18
|
+
/** Sort order */
|
|
19
|
+
sort?: 'newest' | 'top_rated' | 'most_used';
|
|
20
|
+
/** Number of results (default 20, max 100) */
|
|
21
|
+
limit?: number;
|
|
22
|
+
/** Pagination offset */
|
|
23
|
+
offset?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface GenerateGovernanceParams {
|
|
26
|
+
/** Policy documents as plain text */
|
|
27
|
+
policies: string[];
|
|
28
|
+
/** Historical decision logs (CSV rows or JSON objects) */
|
|
29
|
+
decision_logs?: Record<string, unknown>[];
|
|
30
|
+
/** Domain name (e.g. "loan_approval") */
|
|
31
|
+
domain?: string;
|
|
32
|
+
/** Organisation name */
|
|
33
|
+
organisation?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface DetectContradictionsParams {
|
|
36
|
+
/** Array of rules to check */
|
|
37
|
+
rules: Array<{
|
|
38
|
+
id: string;
|
|
39
|
+
condition: string;
|
|
40
|
+
outcome: string;
|
|
41
|
+
priority?: number;
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
44
|
+
export type Verdict = 'auto_approved' | 'auto_rejected' | 'escalated' | 'pending_human_review';
|
|
45
|
+
export interface VerifyDecisionResult {
|
|
46
|
+
/** Whether the decision is permitted under current governance */
|
|
47
|
+
allowed: boolean;
|
|
48
|
+
/** Machine-readable verdict */
|
|
49
|
+
verdict: Verdict;
|
|
50
|
+
/** Human-readable explanation */
|
|
51
|
+
verdict_description: string;
|
|
52
|
+
/** The rule that triggered this verdict (if any) */
|
|
53
|
+
rule_reference?: string;
|
|
54
|
+
/** SHA-256 hash of the audit record — store this for compliance */
|
|
55
|
+
audit_record?: string;
|
|
56
|
+
/** Artifact that governed this decision */
|
|
57
|
+
artifact_id: string;
|
|
58
|
+
/** Execution ID for tracing */
|
|
59
|
+
execution_id?: string;
|
|
60
|
+
/** ISO timestamp */
|
|
61
|
+
decided_at: string;
|
|
62
|
+
}
|
|
63
|
+
export interface Artifact {
|
|
64
|
+
id: string;
|
|
65
|
+
title: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
domain?: string;
|
|
68
|
+
verification_tier: 'DECLARED' | 'VALIDATED' | 'CERTIFIED' | 'PROVEN' | 'SOVEREIGN';
|
|
69
|
+
autonomy_band: 'autonomous' | 'bounded' | 'human_governed';
|
|
70
|
+
ari_score?: number;
|
|
71
|
+
rule_count?: number;
|
|
72
|
+
jurisdiction_tags: string[];
|
|
73
|
+
industry_tags: string[];
|
|
74
|
+
publisher_org?: string;
|
|
75
|
+
seal_hash?: string;
|
|
76
|
+
downloads: number;
|
|
77
|
+
rating?: number;
|
|
78
|
+
price_usd: number;
|
|
79
|
+
published_at?: string;
|
|
80
|
+
created_at: string;
|
|
81
|
+
}
|
|
82
|
+
export interface ArtifactList {
|
|
83
|
+
data: Artifact[];
|
|
84
|
+
total: number;
|
|
85
|
+
limit: number;
|
|
86
|
+
offset: number;
|
|
87
|
+
}
|
|
88
|
+
export interface Contradiction {
|
|
89
|
+
type: 'threshold_conflict' | 'role_conflict' | 'ghost_term' | 'rule_collision' | 'layer_divergence';
|
|
90
|
+
severity: 'critical' | 'warning' | 'info';
|
|
91
|
+
rule_ids: string[];
|
|
92
|
+
description: string;
|
|
93
|
+
suggested_resolution?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface DetectContradictionsResult {
|
|
96
|
+
contradiction_count: number;
|
|
97
|
+
contradictions: Contradiction[];
|
|
98
|
+
clean: boolean;
|
|
99
|
+
}
|
|
100
|
+
export interface GenerateGovernanceResult {
|
|
101
|
+
artifact_id: string;
|
|
102
|
+
seal_hash: string;
|
|
103
|
+
ari_score: number;
|
|
104
|
+
autonomy_band: 'autonomous' | 'bounded' | 'human_governed';
|
|
105
|
+
rule_count: number;
|
|
106
|
+
verification_tier: string;
|
|
107
|
+
download_url?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface NomosConfig {
|
|
110
|
+
/** Base URL override — defaults to https://nomos.ai */
|
|
111
|
+
baseUrl?: string;
|
|
112
|
+
/** Max retries on 429 / 5xx (default: 3) */
|
|
113
|
+
maxRetries?: number;
|
|
114
|
+
/** Request timeout in ms (default: 30000) */
|
|
115
|
+
timeout?: number;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,gBAAgB,CAAC;IACnD,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC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B;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,YAAY,GAAG,SAAS,GAAG,gBAAgB,CAAC;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+EAA+E"}
|
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,wBAAsB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAErD;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAM,GAAG,MAAM,CAGrE;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEnD"}
|
package/dist/util.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export async function sleep(ms) {
|
|
2
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
3
|
+
}
|
|
4
|
+
export function jitteredBackoff(attempt, baseMs = 500) {
|
|
5
|
+
const exp = Math.min(baseMs * 2 ** attempt, 16000);
|
|
6
|
+
return exp * (0.75 + Math.random() * 0.5); // ±25% jitter
|
|
7
|
+
}
|
|
8
|
+
export function isRetryable(status) {
|
|
9
|
+
return status === 429 || status >= 500;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=util.js.map
|
package/dist/util.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,EAAU;IACpC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,MAAM,GAAG,GAAG;IAC3D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,EAAE,KAAK,CAAC,CAAC;IACnD,OAAO,GAAG,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,cAAc;AAC3D,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,OAAO,MAAM,KAAK,GAAG,IAAI,MAAM,IAAI,GAAG,CAAC;AACzC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nomosprotocol/sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Official TypeScript SDK for the NOMOS governance runtime",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"dev": "tsc --watch",
|
|
23
|
+
"clean": "rm -rf dist"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"nomos",
|
|
27
|
+
"governance",
|
|
28
|
+
"ai",
|
|
29
|
+
"compliance",
|
|
30
|
+
"sdk"
|
|
31
|
+
],
|
|
32
|
+
"author": "NOMOS",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"typescript": "^5.9.3"
|
|
39
|
+
}
|
|
40
|
+
}
|