@nobulex/sdk 0.1.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/adapters/express.d.ts +322 -0
- package/dist/adapters/express.d.ts.map +1 -0
- package/dist/adapters/express.js +356 -0
- package/dist/adapters/express.js.map +1 -0
- package/dist/adapters/index.d.ts +15 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +15 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/langchain.d.ts +183 -0
- package/dist/adapters/langchain.d.ts.map +1 -0
- package/dist/adapters/langchain.js +203 -0
- package/dist/adapters/langchain.js.map +1 -0
- package/dist/adapters/vercel-ai.d.ts +122 -0
- package/dist/adapters/vercel-ai.d.ts.map +1 -0
- package/dist/adapters/vercel-ai.js +128 -0
- package/dist/adapters/vercel-ai.js.map +1 -0
- package/dist/benchmarks.d.ts +164 -0
- package/dist/benchmarks.d.ts.map +1 -0
- package/dist/benchmarks.js +327 -0
- package/dist/benchmarks.js.map +1 -0
- package/dist/benchmarks.test.d.ts +2 -0
- package/dist/benchmarks.test.d.ts.map +1 -0
- package/dist/benchmarks.test.js +71 -0
- package/dist/benchmarks.test.js.map +1 -0
- package/dist/conformance.d.ts +160 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +1242 -0
- package/dist/conformance.js.map +1 -0
- package/dist/events.d.ts +176 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +208 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +384 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +695 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +986 -0
- package/dist/index.test.js.map +1 -0
- package/dist/middleware.d.ts +104 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +222 -0
- package/dist/middleware.js.map +1 -0
- package/dist/middleware.test.d.ts +5 -0
- package/dist/middleware.test.d.ts.map +1 -0
- package/dist/middleware.test.js +735 -0
- package/dist/middleware.test.js.map +1 -0
- package/dist/plugins/auth.d.ts +49 -0
- package/dist/plugins/auth.d.ts.map +1 -0
- package/dist/plugins/auth.js +82 -0
- package/dist/plugins/auth.js.map +1 -0
- package/dist/plugins/cache.d.ts +40 -0
- package/dist/plugins/cache.d.ts.map +1 -0
- package/dist/plugins/cache.js +191 -0
- package/dist/plugins/cache.js.map +1 -0
- package/dist/plugins/index.d.ts +16 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +12 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/metrics-plugin.d.ts +32 -0
- package/dist/plugins/metrics-plugin.d.ts.map +1 -0
- package/dist/plugins/metrics-plugin.js +61 -0
- package/dist/plugins/metrics-plugin.js.map +1 -0
- package/dist/plugins/plugins.test.d.ts +8 -0
- package/dist/plugins/plugins.test.d.ts.map +1 -0
- package/dist/plugins/plugins.test.js +640 -0
- package/dist/plugins/plugins.test.js.map +1 -0
- package/dist/plugins/retry-plugin.d.ts +55 -0
- package/dist/plugins/retry-plugin.d.ts.map +1 -0
- package/dist/plugins/retry-plugin.js +133 -0
- package/dist/plugins/retry-plugin.js.map +1 -0
- package/dist/telemetry.d.ts +183 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +241 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/types.d.ts +200 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenTelemetry-compatible instrumentation for the Stele SDK.
|
|
3
|
+
*
|
|
4
|
+
* Follows the "bring your own tracer" pattern: all OTel interfaces are
|
|
5
|
+
* defined inline so consumers can plug in their own OTel SDK without
|
|
6
|
+
* introducing any external dependency on `@opentelemetry/*` packages.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
// ─── OTel-compatible interfaces ──────────────────────────────────────────────
|
|
11
|
+
/** Status code constants compatible with @opentelemetry/api SpanStatusCode. */
|
|
12
|
+
export const SpanStatusCode = {
|
|
13
|
+
UNSET: 0,
|
|
14
|
+
OK: 1,
|
|
15
|
+
ERROR: 2,
|
|
16
|
+
};
|
|
17
|
+
// ─── No-op implementations ──────────────────────────────────────────────────
|
|
18
|
+
/** No-op Span that silently discards all calls. */
|
|
19
|
+
export class NoopSpan {
|
|
20
|
+
setAttribute(_key, _value) { }
|
|
21
|
+
setStatus(_status) { }
|
|
22
|
+
recordException(_error) { }
|
|
23
|
+
end() { }
|
|
24
|
+
}
|
|
25
|
+
/** No-op Counter that silently discards all calls. */
|
|
26
|
+
export class NoopCounter {
|
|
27
|
+
add(_value, _attributes) { }
|
|
28
|
+
}
|
|
29
|
+
/** No-op Histogram that silently discards all calls. */
|
|
30
|
+
export class NoopHistogram {
|
|
31
|
+
record(_value, _attributes) { }
|
|
32
|
+
}
|
|
33
|
+
/** No-op Tracer that returns NoopSpan instances. */
|
|
34
|
+
export class NoopTracer {
|
|
35
|
+
startSpan(_name, _options) {
|
|
36
|
+
return new NoopSpan();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** No-op Meter that returns NoopCounter and NoopHistogram instances. */
|
|
40
|
+
export class NoopMeter {
|
|
41
|
+
createCounter(_name, _options) {
|
|
42
|
+
return new NoopCounter();
|
|
43
|
+
}
|
|
44
|
+
createHistogram(_name, _options) {
|
|
45
|
+
return new NoopHistogram();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a SteleMiddleware that wraps each operation with an OTel span.
|
|
50
|
+
*
|
|
51
|
+
* For every operation that passes through the middleware pipeline, this
|
|
52
|
+
* middleware:
|
|
53
|
+
* - Creates a span named after the operation (e.g. `stele.createCovenant`)
|
|
54
|
+
* - Sets attributes: `stele.operation`, and any result-specific attributes
|
|
55
|
+
* such as `stele.covenant.id`, `stele.evaluation.permitted`
|
|
56
|
+
* - Records duration via `stele.duration_ms`
|
|
57
|
+
* - Sets the span status to OK or ERROR
|
|
58
|
+
* - Records exceptions on failure
|
|
59
|
+
*
|
|
60
|
+
* @param options - Optional configuration with a custom tracer.
|
|
61
|
+
* @returns A SteleMiddleware instance.
|
|
62
|
+
*/
|
|
63
|
+
export function telemetryMiddleware(options) {
|
|
64
|
+
const tracer = options?.tracer ?? new NoopTracer();
|
|
65
|
+
return {
|
|
66
|
+
name: 'telemetry',
|
|
67
|
+
async before(ctx) {
|
|
68
|
+
const span = tracer.startSpan(`stele.${ctx.operation}`, {
|
|
69
|
+
attributes: {
|
|
70
|
+
'stele.operation': ctx.operation,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
ctx.metadata._telemetrySpan = span;
|
|
74
|
+
ctx.metadata._telemetryStart = performance.now();
|
|
75
|
+
return { proceed: true };
|
|
76
|
+
},
|
|
77
|
+
async after(ctx, result) {
|
|
78
|
+
const span = ctx.metadata._telemetrySpan;
|
|
79
|
+
if (span) {
|
|
80
|
+
const start = ctx.metadata._telemetryStart;
|
|
81
|
+
const durationMs = performance.now() - start;
|
|
82
|
+
span.setAttribute('stele.duration_ms', durationMs);
|
|
83
|
+
// Set result-specific attributes
|
|
84
|
+
if (result && typeof result === 'object') {
|
|
85
|
+
const r = result;
|
|
86
|
+
if ('id' in r && typeof r.id === 'string') {
|
|
87
|
+
span.setAttribute('stele.covenant.id', r.id);
|
|
88
|
+
}
|
|
89
|
+
if ('valid' in r && typeof r.valid === 'boolean') {
|
|
90
|
+
span.setAttribute('stele.verification.valid', r.valid);
|
|
91
|
+
}
|
|
92
|
+
if ('permitted' in r && typeof r.permitted === 'boolean') {
|
|
93
|
+
span.setAttribute('stele.evaluation.permitted', r.permitted);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
97
|
+
span.end();
|
|
98
|
+
delete ctx.metadata._telemetrySpan;
|
|
99
|
+
delete ctx.metadata._telemetryStart;
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
},
|
|
103
|
+
async onError(ctx, error) {
|
|
104
|
+
const span = ctx.metadata._telemetrySpan;
|
|
105
|
+
if (span) {
|
|
106
|
+
const start = ctx.metadata._telemetryStart;
|
|
107
|
+
const durationMs = performance.now() - start;
|
|
108
|
+
span.setAttribute('stele.duration_ms', durationMs);
|
|
109
|
+
span.setStatus({ code: SpanStatusCode.ERROR, message: error.message });
|
|
110
|
+
span.recordException(error);
|
|
111
|
+
span.end();
|
|
112
|
+
delete ctx.metadata._telemetrySpan;
|
|
113
|
+
delete ctx.metadata._telemetryStart;
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Metrics collector for Stele SDK operations.
|
|
120
|
+
*
|
|
121
|
+
* Creates OTel-compatible counters and histograms and exposes a `record()`
|
|
122
|
+
* method to update them from SteleClient lifecycle events.
|
|
123
|
+
*/
|
|
124
|
+
export class SteleMetrics {
|
|
125
|
+
_covenantsCreated;
|
|
126
|
+
_covenantsVerified;
|
|
127
|
+
_evaluationsTotal;
|
|
128
|
+
_evaluationsDenied;
|
|
129
|
+
_operationDuration;
|
|
130
|
+
constructor(meter) {
|
|
131
|
+
this._covenantsCreated = meter.createCounter('stele.covenants.created', {
|
|
132
|
+
description: 'Number of covenants created',
|
|
133
|
+
});
|
|
134
|
+
this._covenantsVerified = meter.createCounter('stele.covenants.verified', {
|
|
135
|
+
description: 'Number of covenants verified',
|
|
136
|
+
});
|
|
137
|
+
this._evaluationsTotal = meter.createCounter('stele.evaluations.total', {
|
|
138
|
+
description: 'Total number of evaluations performed',
|
|
139
|
+
});
|
|
140
|
+
this._evaluationsDenied = meter.createCounter('stele.evaluations.denied', {
|
|
141
|
+
description: 'Number of evaluations that were denied',
|
|
142
|
+
});
|
|
143
|
+
this._operationDuration = meter.createHistogram('stele.operation.duration', {
|
|
144
|
+
description: 'Duration of operations in milliseconds',
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Record a SteleClient event, updating the appropriate metrics.
|
|
149
|
+
*
|
|
150
|
+
* @param event - A SteleClient lifecycle event (from the `on()` callback).
|
|
151
|
+
*/
|
|
152
|
+
record(event) {
|
|
153
|
+
switch (event.type) {
|
|
154
|
+
case 'covenant:created':
|
|
155
|
+
this._covenantsCreated.add(1);
|
|
156
|
+
break;
|
|
157
|
+
case 'covenant:verified':
|
|
158
|
+
this._covenantsVerified.add(1);
|
|
159
|
+
break;
|
|
160
|
+
case 'evaluation:completed': {
|
|
161
|
+
const evalEvent = event;
|
|
162
|
+
this._evaluationsTotal.add(1);
|
|
163
|
+
if (!evalEvent.result.permitted) {
|
|
164
|
+
this._evaluationsDenied.add(1);
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
default:
|
|
169
|
+
// Other event types are observed but do not drive specific counters.
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Record an operation duration.
|
|
175
|
+
*
|
|
176
|
+
* @param durationMs - Duration in milliseconds.
|
|
177
|
+
* @param attributes - Optional attributes to attach to the measurement.
|
|
178
|
+
*/
|
|
179
|
+
recordDuration(durationMs, attributes) {
|
|
180
|
+
this._operationDuration.record(durationMs, attributes);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Subscribe to all SteleClient events and automatically record metrics.
|
|
184
|
+
*
|
|
185
|
+
* @param client - An object with an `on()` method matching SteleClient's API.
|
|
186
|
+
* @returns An array of disposal functions that unsubscribe all listeners.
|
|
187
|
+
*/
|
|
188
|
+
bindToClient(client) {
|
|
189
|
+
const disposers = [];
|
|
190
|
+
const eventTypes = [
|
|
191
|
+
'covenant:created',
|
|
192
|
+
'covenant:verified',
|
|
193
|
+
'covenant:countersigned',
|
|
194
|
+
'identity:created',
|
|
195
|
+
'identity:evolved',
|
|
196
|
+
'chain:resolved',
|
|
197
|
+
'chain:validated',
|
|
198
|
+
'evaluation:completed',
|
|
199
|
+
];
|
|
200
|
+
for (const eventType of eventTypes) {
|
|
201
|
+
const dispose = client.on(eventType, (data) => {
|
|
202
|
+
this.record(data);
|
|
203
|
+
});
|
|
204
|
+
disposers.push(dispose);
|
|
205
|
+
}
|
|
206
|
+
return disposers;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Create a matched pair of telemetry middleware and metrics collector.
|
|
211
|
+
*
|
|
212
|
+
* This is the recommended entry point for instrumenting the Stele SDK.
|
|
213
|
+
* If no tracer or meter is provided, no-op implementations are used
|
|
214
|
+
* so that application code compiles and runs without any OTel dependency.
|
|
215
|
+
*
|
|
216
|
+
* @param options - Optional tracer and meter instances.
|
|
217
|
+
* @returns An object containing the middleware and metrics instances.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* import { createTelemetry } from '@nobulex/sdk';
|
|
222
|
+
*
|
|
223
|
+
* // With real OTel SDK:
|
|
224
|
+
* const { middleware, metrics } = createTelemetry({
|
|
225
|
+
* tracer: otelTrace.getTracer('my-app'),
|
|
226
|
+
* meter: otelMetrics.getMeter('my-app'),
|
|
227
|
+
* });
|
|
228
|
+
*
|
|
229
|
+
* // Without OTel (no-op, zero overhead):
|
|
230
|
+
* const { middleware, metrics } = createTelemetry();
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
export function createTelemetry(options) {
|
|
234
|
+
const tracer = options?.tracer ?? new NoopTracer();
|
|
235
|
+
const meter = options?.meter ?? new NoopMeter();
|
|
236
|
+
return {
|
|
237
|
+
middleware: telemetryMiddleware({ tracer }),
|
|
238
|
+
metrics: new SteleMetrics(meter),
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=telemetry.js.map
|
|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OAKG;IACH,cAAc,CAAC,UAAkB,EAAE,UAAmC;QACpE,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACH,YAAY,CAAC,MAAmB;QAC9B,MAAM,SAAS,GAAmB,EAAE,CAAC;QAErC,MAAM,UAAU,GAAqB;YACnC,kBAAkB;YAClB,mBAAmB;YACnB,wBAAwB;YACxB,kBAAkB;YAClB,kBAAkB;YAClB,gBAAgB;YAChB,iBAAiB;YACjB,sBAAsB;SACvB,CAAC;QAEF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;gBAC5C,IAAI,CAAC,MAAM,CAAC,IAAkB,CAAC,CAAC;YAClC,CAAC,CAAC,CAAC;YACH,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAYD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,eAAe,CAAC,OAAgC;IAI9D,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;IACnD,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,IAAI,SAAS,EAAE,CAAC;IAEhD,OAAO;QACL,UAAU,EAAE,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3C,OAAO,EAAE,IAAI,YAAY,CAAC,KAAK,CAAC;KACjC,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nobulex/sdk type definitions.
|
|
3
|
+
*
|
|
4
|
+
* SDK-specific types that wrap and extend the lower-level package types
|
|
5
|
+
* into a unified, ergonomic API surface.
|
|
6
|
+
*/
|
|
7
|
+
import type { KeyPair } from '@nobulex/crypto';
|
|
8
|
+
import type { CovenantDocument, VerificationResult, VerificationCheck, Issuer, Beneficiary, ChainReference, EnforcementConfig, ProofConfig, RevocationConfig, CovenantMetadata, Obligation, PartyRole } from '@nobulex/core';
|
|
9
|
+
import type { CCLDocument, EvaluationResult as CCLEvaluationResult, Statement, Severity } from '@nobulex/ccl';
|
|
10
|
+
import type { AgentIdentity, ModelAttestation, DeploymentContext, LineageEntry } from '@nobulex/identity';
|
|
11
|
+
/** Options for constructing a SteleClient instance. */
|
|
12
|
+
export interface SteleClientOptions {
|
|
13
|
+
/** Optional pre-generated key pair for signing operations. */
|
|
14
|
+
keyPair?: KeyPair;
|
|
15
|
+
/** Optional agent identifier for identity operations. */
|
|
16
|
+
agentId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* When true, the client will throw on verification failures
|
|
19
|
+
* instead of returning a result with valid=false.
|
|
20
|
+
*/
|
|
21
|
+
strictMode?: boolean;
|
|
22
|
+
/** Optional key rotation policy for automatic key lifecycle management. */
|
|
23
|
+
keyRotation?: {
|
|
24
|
+
/** Maximum key age in milliseconds before rotation is required. */
|
|
25
|
+
maxAgeMs: number;
|
|
26
|
+
/** Grace period in milliseconds where both old and new keys are valid. */
|
|
27
|
+
overlapPeriodMs: number;
|
|
28
|
+
/** Optional callback invoked when rotation occurs. */
|
|
29
|
+
onRotation?: (oldKey: string, newKey: string) => void;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Options for creating a new covenant through the SDK. */
|
|
33
|
+
export interface CreateCovenantOptions {
|
|
34
|
+
/** The issuing party. */
|
|
35
|
+
issuer: Issuer;
|
|
36
|
+
/** The beneficiary party. */
|
|
37
|
+
beneficiary: Beneficiary;
|
|
38
|
+
/** CCL constraint source text. */
|
|
39
|
+
constraints: string;
|
|
40
|
+
/** Issuer's private key used to sign the document. If omitted, uses client keyPair. */
|
|
41
|
+
privateKey?: Uint8Array;
|
|
42
|
+
/** Optional obligations. */
|
|
43
|
+
obligations?: Obligation[];
|
|
44
|
+
/** Optional chain reference to parent covenant. */
|
|
45
|
+
chain?: ChainReference;
|
|
46
|
+
/** Optional enforcement configuration. */
|
|
47
|
+
enforcement?: EnforcementConfig;
|
|
48
|
+
/** Optional proof configuration. */
|
|
49
|
+
proof?: ProofConfig;
|
|
50
|
+
/** Optional revocation configuration. */
|
|
51
|
+
revocation?: RevocationConfig;
|
|
52
|
+
/** Optional metadata. */
|
|
53
|
+
metadata?: CovenantMetadata;
|
|
54
|
+
/** Optional ISO 8601 expiry timestamp. */
|
|
55
|
+
expiresAt?: string;
|
|
56
|
+
/** Optional ISO 8601 activation timestamp. */
|
|
57
|
+
activatesAt?: string;
|
|
58
|
+
}
|
|
59
|
+
/** Result of evaluating an action against a covenant's constraints. */
|
|
60
|
+
export interface EvaluationResult {
|
|
61
|
+
/** Whether the action is permitted. */
|
|
62
|
+
permitted: boolean;
|
|
63
|
+
/** The matched rule, if any. */
|
|
64
|
+
matchedRule?: Statement;
|
|
65
|
+
/** All matching statements. */
|
|
66
|
+
allMatches: Statement[];
|
|
67
|
+
/** Human-readable reason for the decision. */
|
|
68
|
+
reason?: string;
|
|
69
|
+
/** Severity of the matched rule. */
|
|
70
|
+
severity?: Severity;
|
|
71
|
+
}
|
|
72
|
+
/** Options for creating a new agent identity through the SDK. */
|
|
73
|
+
export interface CreateIdentityOptions {
|
|
74
|
+
/** Operator key pair for signing. If omitted, uses client keyPair. */
|
|
75
|
+
operatorKeyPair?: KeyPair;
|
|
76
|
+
/** Optional human-readable operator identifier. */
|
|
77
|
+
operatorIdentifier?: string;
|
|
78
|
+
/** Model attestation describing the AI model. */
|
|
79
|
+
model: ModelAttestation;
|
|
80
|
+
/** List of capabilities this agent has. */
|
|
81
|
+
capabilities: string[];
|
|
82
|
+
/** Deployment context describing where the agent runs. */
|
|
83
|
+
deployment: DeploymentContext;
|
|
84
|
+
}
|
|
85
|
+
/** Options for evolving an existing agent identity. */
|
|
86
|
+
export interface EvolveOptions {
|
|
87
|
+
/** Operator key pair for signing. If omitted, uses client keyPair. */
|
|
88
|
+
operatorKeyPair?: KeyPair;
|
|
89
|
+
/** Type of change being made. */
|
|
90
|
+
changeType: LineageEntry['changeType'];
|
|
91
|
+
/** Human-readable description of the change. */
|
|
92
|
+
description: string;
|
|
93
|
+
/** The fields being updated. */
|
|
94
|
+
updates: {
|
|
95
|
+
model?: ModelAttestation;
|
|
96
|
+
capabilities?: string[];
|
|
97
|
+
deployment?: DeploymentContext;
|
|
98
|
+
operatorPublicKey?: string;
|
|
99
|
+
operatorIdentifier?: string;
|
|
100
|
+
};
|
|
101
|
+
/** Optional explicit reputation carry-forward rate. */
|
|
102
|
+
reputationCarryForward?: number;
|
|
103
|
+
}
|
|
104
|
+
/** Result of validating a chain of covenant documents. */
|
|
105
|
+
export interface ChainValidationResult {
|
|
106
|
+
/** Whether the entire chain is valid. */
|
|
107
|
+
valid: boolean;
|
|
108
|
+
/** Per-document verification results, ordered from root to leaf. */
|
|
109
|
+
results: VerificationResult[];
|
|
110
|
+
/** Narrowing violations found between parent-child pairs. */
|
|
111
|
+
narrowingViolations: NarrowingViolationEntry[];
|
|
112
|
+
}
|
|
113
|
+
/** A narrowing violation between a specific parent-child pair. */
|
|
114
|
+
export interface NarrowingViolationEntry {
|
|
115
|
+
/** Index of the child document in the chain. */
|
|
116
|
+
childIndex: number;
|
|
117
|
+
/** Index of the parent document in the chain. */
|
|
118
|
+
parentIndex: number;
|
|
119
|
+
/** The narrowing violations found. */
|
|
120
|
+
violations: Array<{
|
|
121
|
+
childRule: Statement;
|
|
122
|
+
parentRule: Statement;
|
|
123
|
+
reason: string;
|
|
124
|
+
}>;
|
|
125
|
+
}
|
|
126
|
+
/** Event types emitted by SteleClient. */
|
|
127
|
+
export type SteleEventType = 'covenant:created' | 'covenant:verified' | 'covenant:countersigned' | 'identity:created' | 'identity:evolved' | 'chain:resolved' | 'chain:validated' | 'evaluation:completed' | 'key:rotated';
|
|
128
|
+
/** Base event payload. */
|
|
129
|
+
export interface SteleEvent {
|
|
130
|
+
/** The event type. */
|
|
131
|
+
type: SteleEventType;
|
|
132
|
+
/** ISO 8601 timestamp of when the event occurred. */
|
|
133
|
+
timestamp: string;
|
|
134
|
+
}
|
|
135
|
+
/** Event emitted when a covenant is created. */
|
|
136
|
+
export interface CovenantCreatedEvent extends SteleEvent {
|
|
137
|
+
type: 'covenant:created';
|
|
138
|
+
document: CovenantDocument;
|
|
139
|
+
}
|
|
140
|
+
/** Event emitted when a covenant is verified. */
|
|
141
|
+
export interface CovenantVerifiedEvent extends SteleEvent {
|
|
142
|
+
type: 'covenant:verified';
|
|
143
|
+
result: VerificationResult;
|
|
144
|
+
}
|
|
145
|
+
/** Event emitted when a covenant is countersigned. */
|
|
146
|
+
export interface CovenantCountersignedEvent extends SteleEvent {
|
|
147
|
+
type: 'covenant:countersigned';
|
|
148
|
+
document: CovenantDocument;
|
|
149
|
+
signerRole: PartyRole;
|
|
150
|
+
}
|
|
151
|
+
/** Event emitted when an identity is created. */
|
|
152
|
+
export interface IdentityCreatedEvent extends SteleEvent {
|
|
153
|
+
type: 'identity:created';
|
|
154
|
+
identity: AgentIdentity;
|
|
155
|
+
}
|
|
156
|
+
/** Event emitted when an identity is evolved. */
|
|
157
|
+
export interface IdentityEvolvedEvent extends SteleEvent {
|
|
158
|
+
type: 'identity:evolved';
|
|
159
|
+
identity: AgentIdentity;
|
|
160
|
+
changeType: LineageEntry['changeType'];
|
|
161
|
+
}
|
|
162
|
+
/** Event emitted when a chain is resolved. */
|
|
163
|
+
export interface ChainResolvedEvent extends SteleEvent {
|
|
164
|
+
type: 'chain:resolved';
|
|
165
|
+
documents: CovenantDocument[];
|
|
166
|
+
}
|
|
167
|
+
/** Event emitted when a chain is validated. */
|
|
168
|
+
export interface ChainValidatedEvent extends SteleEvent {
|
|
169
|
+
type: 'chain:validated';
|
|
170
|
+
result: ChainValidationResult;
|
|
171
|
+
}
|
|
172
|
+
/** Event emitted when an action is evaluated. */
|
|
173
|
+
export interface EvaluationCompletedEvent extends SteleEvent {
|
|
174
|
+
type: 'evaluation:completed';
|
|
175
|
+
result: EvaluationResult;
|
|
176
|
+
action: string;
|
|
177
|
+
resource: string;
|
|
178
|
+
}
|
|
179
|
+
/** Event emitted when a key rotation occurs. */
|
|
180
|
+
export interface KeyRotatedEvent extends SteleEvent {
|
|
181
|
+
type: 'key:rotated';
|
|
182
|
+
previousPublicKey: string;
|
|
183
|
+
currentPublicKey: string;
|
|
184
|
+
}
|
|
185
|
+
/** Map of event types to their payloads. */
|
|
186
|
+
export interface SteleEventMap {
|
|
187
|
+
'covenant:created': CovenantCreatedEvent;
|
|
188
|
+
'covenant:verified': CovenantVerifiedEvent;
|
|
189
|
+
'covenant:countersigned': CovenantCountersignedEvent;
|
|
190
|
+
'identity:created': IdentityCreatedEvent;
|
|
191
|
+
'identity:evolved': IdentityEvolvedEvent;
|
|
192
|
+
'chain:resolved': ChainResolvedEvent;
|
|
193
|
+
'chain:validated': ChainValidatedEvent;
|
|
194
|
+
'evaluation:completed': EvaluationCompletedEvent;
|
|
195
|
+
'key:rotated': KeyRotatedEvent;
|
|
196
|
+
}
|
|
197
|
+
/** Event handler function type. */
|
|
198
|
+
export type SteleEventHandler<T extends SteleEventType> = (event: SteleEventMap[T]) => void;
|
|
199
|
+
export type { KeyPair, CovenantDocument, VerificationResult, VerificationCheck, Issuer, Beneficiary, ChainReference, EnforcementConfig, ProofConfig, RevocationConfig, CovenantMetadata, Obligation, PartyRole, CCLDocument, CCLEvaluationResult, Statement, Severity, AgentIdentity, ModelAttestation, DeploymentContext, LineageEntry, };
|
|
200
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EACV,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AiB,EAAE,mBAAmB,CAAC;IACvC,sBAAsB,EAAE,wBAAwB,CAAC;IACjD,aAAa,EAAE,eAAe,CAAC;CAChC;AAED,mCAAmC;AACnC,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,cAAc,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAI5F,YAAY,EACV,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nobulex/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TypeScript SDK for embedding Stele into agent frameworks and applications",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc --project tsconfig.json",
|
|
15
|
+
"typecheck": "tsc --noEmit",
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@nobulex/types": "0.1.0",
|
|
21
|
+
"@nobulex/crypto": "0.1.0",
|
|
22
|
+
"@nobulex/core": "0.1.0",
|
|
23
|
+
"@nobulex/ccl": "0.1.0",
|
|
24
|
+
"@nobulex/identity": "0.1.0",
|
|
25
|
+
"@nobulex/store": "0.1.0",
|
|
26
|
+
"@nobulex/verifier": "0.1.0",
|
|
27
|
+
"@nobulex/negotiation": "0.1.0"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/agbusiness195/Stele.git",
|
|
39
|
+
"directory": "packages/sdk"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://stele.dev",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/agbusiness195/stele/issues"
|
|
44
|
+
},
|
|
45
|
+
"author": "Stele Labs, Inc.",
|
|
46
|
+
"keywords": [
|
|
47
|
+
"stele",
|
|
48
|
+
"covenant",
|
|
49
|
+
"ai-accountability",
|
|
50
|
+
"sdk"
|
|
51
|
+
]
|
|
52
|
+
}
|