@nextera.one/axis-server-sdk 2.2.1 → 2.2.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.
Files changed (49) hide show
  1. package/dist/axis-sensor-GBEI3Fab.d.mts +209 -0
  2. package/dist/axis-sensor-GBEI3Fab.d.ts +209 -0
  3. package/dist/cce/index.d.mts +162 -0
  4. package/dist/cce/index.d.ts +162 -0
  5. package/dist/cce/index.js +1502 -0
  6. package/dist/cce/index.js.map +1 -0
  7. package/dist/cce/index.mjs +1442 -0
  8. package/dist/cce/index.mjs.map +1 -0
  9. package/dist/cce-pipeline-B-zUBHo3.d.mts +294 -0
  10. package/dist/cce-pipeline-DbGBSsCG.d.ts +294 -0
  11. package/dist/idel/index.d.mts +24 -0
  12. package/dist/idel/index.d.ts +24 -0
  13. package/dist/idel/index.js +306 -0
  14. package/dist/idel/index.js.map +1 -0
  15. package/dist/idel/index.mjs +279 -0
  16. package/dist/idel/index.mjs.map +1 -0
  17. package/dist/idel.types-DuUAcOnQ.d.mts +83 -0
  18. package/dist/idel.types-DuUAcOnQ.d.ts +83 -0
  19. package/dist/index-B2G6cbRL.d.mts +824 -0
  20. package/dist/index-DbSxdR0f.d.ts +824 -0
  21. package/dist/index-_S4fmVUJ.d.mts +501 -0
  22. package/dist/index-l3Hhirqb.d.ts +501 -0
  23. package/dist/index.d.mts +91 -1891
  24. package/dist/index.d.ts +91 -1891
  25. package/dist/index.js +9339 -5123
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +10326 -5816
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/needle/index.d.mts +4 -0
  30. package/dist/needle/index.d.ts +4 -0
  31. package/dist/needle/index.js +3499 -0
  32. package/dist/needle/index.js.map +1 -0
  33. package/dist/needle/index.mjs +3528 -0
  34. package/dist/needle/index.mjs.map +1 -0
  35. package/dist/sensors/index.d.mts +5 -0
  36. package/dist/sensors/index.d.ts +5 -0
  37. package/dist/sensors/index.js +12860 -0
  38. package/dist/sensors/index.js.map +1 -0
  39. package/dist/sensors/index.mjs +12928 -0
  40. package/dist/sensors/index.mjs.map +1 -0
  41. package/dist/timeline/index.d.mts +54 -0
  42. package/dist/timeline/index.d.ts +54 -0
  43. package/dist/timeline/index.js +389 -0
  44. package/dist/timeline/index.js.map +1 -0
  45. package/dist/timeline/index.mjs +362 -0
  46. package/dist/timeline/index.mjs.map +1 -0
  47. package/dist/timeline.types-Cn0aqbUj.d.mts +125 -0
  48. package/dist/timeline.types-Cn0aqbUj.d.ts +125 -0
  49. package/package.json +28 -10
@@ -0,0 +1,501 @@
1
+ import { c as CompiledIntent } from './idel.types-DuUAcOnQ.js';
2
+ import { i as TimelineEvent } from './timeline.types-Cn0aqbUj.js';
3
+ import { A as AxisSensor } from './axis-sensor-GBEI3Fab.js';
4
+
5
+ interface ObservationStage {
6
+ name: string;
7
+ status: 'ok' | 'fail' | 'skip';
8
+ startMs: number;
9
+ endMs?: number;
10
+ durationMs?: number;
11
+ reason?: string;
12
+ code?: string;
13
+ }
14
+ interface ObservationSensor {
15
+ name: string;
16
+ allowed: boolean;
17
+ riskScore: number;
18
+ durationMs: number;
19
+ reasons: string[];
20
+ code?: string;
21
+ }
22
+ interface AxisObservation {
23
+ id: string;
24
+ startMs: number;
25
+ transport: 'http' | 'ws';
26
+ ip?: string;
27
+ intent?: string;
28
+ actorId?: string;
29
+ capsuleId?: string;
30
+ stages: ObservationStage[];
31
+ sensors: ObservationSensor[];
32
+ decision?: 'ALLOW' | 'DENY';
33
+ resultCode?: string;
34
+ statusCode?: number;
35
+ endMs?: number;
36
+ durationMs?: number;
37
+ facts: Record<string, unknown>;
38
+ }
39
+ declare function createObservation(transport: 'http' | 'ws', ip?: string): AxisObservation;
40
+ declare function startStage(obs: AxisObservation, name: string): ObservationStage;
41
+ declare function endStage(stage: ObservationStage, status?: 'ok' | 'fail' | 'skip', reason?: string, code?: string): void;
42
+ declare function recordSensor(obs: AxisObservation, name: string, allowed: boolean, riskScore: number, durationMs: number, reasons: string[], code?: string): void;
43
+ declare function finalizeObservation(obs: AxisObservation, decision: 'ALLOW' | 'DENY', statusCode: number, resultCode?: string): void;
44
+
45
+ type TruthStatus = 'confirmed' | 'partial' | 'uncertain' | 'failed' | 'disputed';
46
+ interface ExpectedOutcome {
47
+ decision?: 'ALLOW' | 'DENY';
48
+ effect?: string;
49
+ statusCode?: number;
50
+ ok?: boolean;
51
+ stateChanges?: Record<string, unknown>;
52
+ maxDurationMs?: number;
53
+ minSensorsPassed?: number;
54
+ assertions?: Record<string, unknown>;
55
+ }
56
+ type AnomalyLevel = 'info' | 'warning' | 'critical';
57
+ interface Anomaly {
58
+ code: string;
59
+ level: AnomalyLevel;
60
+ message: string;
61
+ field?: string;
62
+ expected?: unknown;
63
+ actual?: unknown;
64
+ }
65
+ interface TruthVerdict {
66
+ status: TruthStatus;
67
+ confidence: number;
68
+ anomalies: Anomaly[];
69
+ passedChecks: number;
70
+ totalChecks: number;
71
+ verifiedAt: number;
72
+ isDeed: boolean;
73
+ }
74
+ declare function scoreTruth(obs: AxisObservation, expected?: ExpectedOutcome): TruthVerdict;
75
+ interface ObservedDeed {
76
+ observation: AxisObservation;
77
+ verdict: TruthVerdict;
78
+ }
79
+ declare function verifyObservation(obs: AxisObservation, expected?: ExpectedOutcome): ObservedDeed;
80
+
81
+ interface PresenceDeclaration {
82
+ softid: string;
83
+ device_meta?: {
84
+ fingerprint?: string;
85
+ platform?: string;
86
+ user_agent?: string;
87
+ };
88
+ }
89
+ interface PresenceChallenge {
90
+ challenge_id: string;
91
+ nonce: string;
92
+ temporal_anchor: number;
93
+ ttl_ms: number;
94
+ expires_at: number;
95
+ }
96
+ interface PresenceProof {
97
+ challenge_id: string;
98
+ signature: string;
99
+ public_key: string;
100
+ kid?: string;
101
+ }
102
+ interface PresenceReceipt {
103
+ presence_id: string;
104
+ softid: string;
105
+ anchor_reflection: string;
106
+ scope: {
107
+ ip?: string;
108
+ device_fingerprint?: string;
109
+ };
110
+ issued_at: number;
111
+ expires_at: number;
112
+ renewed_at?: number;
113
+ }
114
+ type PresenceStatus = 'active' | 'expired' | 'revoked';
115
+ interface WritHead {
116
+ tid: string;
117
+ seq: number;
118
+ }
119
+ interface WritBody {
120
+ who: string;
121
+ act: string;
122
+ res: string;
123
+ law: string;
124
+ }
125
+ interface WritMeta {
126
+ iat: number;
127
+ exp: number;
128
+ prev: string;
129
+ }
130
+ interface WritSignature {
131
+ alg: 'ed25519';
132
+ value: string;
133
+ kid?: string;
134
+ }
135
+ interface Writ {
136
+ head: WritHead;
137
+ body: WritBody;
138
+ meta: WritMeta;
139
+ sig: WritSignature;
140
+ }
141
+ type GrantType = 'sovereign' | 'delegated' | 'system';
142
+ interface GrantCapability {
143
+ oec: string;
144
+ scope: string;
145
+ limit?: {
146
+ rate?: string;
147
+ amount?: number;
148
+ depth?: string;
149
+ };
150
+ }
151
+ interface GrantMeta {
152
+ iat: number;
153
+ exp: number;
154
+ revocable: boolean;
155
+ version: number;
156
+ contract_ref?: string;
157
+ }
158
+ interface Grant {
159
+ grant_id: string;
160
+ issuer: string;
161
+ subject: string;
162
+ grant_type: GrantType;
163
+ caps: GrantCapability[];
164
+ meta: GrantMeta;
165
+ sig: WritSignature;
166
+ }
167
+ type GrantStatus = 'active' | 'revoked' | 'expired';
168
+ interface LoomReceipt {
169
+ receipt_id: string;
170
+ writ_hash: string;
171
+ thread_id: string;
172
+ sequence: number;
173
+ effect: string;
174
+ hash: string;
175
+ prev_hash: string | null;
176
+ executed_at: number;
177
+ metadata?: Record<string, unknown>;
178
+ }
179
+ interface ThreadState {
180
+ thread_id: string;
181
+ softid: string;
182
+ last_receipt_hash: string;
183
+ sequence: number;
184
+ updated_at: number;
185
+ }
186
+ type RevocationTargetType = 'grant' | 'presence' | 'softid';
187
+ interface Revocation {
188
+ revocation_id: string;
189
+ target_type: RevocationTargetType;
190
+ target_id: string;
191
+ issuer_softid: string;
192
+ reason?: string;
193
+ effective_at: number;
194
+ sig_value: string;
195
+ }
196
+ interface LoomValidationResult {
197
+ valid: boolean;
198
+ error?: string;
199
+ code?: string;
200
+ }
201
+ interface PresenceVerifyResult extends LoomValidationResult {
202
+ presence?: PresenceReceipt;
203
+ }
204
+ interface WritValidationResult extends LoomValidationResult {
205
+ writ?: Writ;
206
+ gate_failed?: 'temporal' | 'causal' | 'legal' | 'authentic';
207
+ }
208
+ interface GrantValidationResult extends LoomValidationResult {
209
+ grant?: Grant;
210
+ }
211
+
212
+ declare function deriveAnchorReflection(softid: string, context?: string, scope?: string): string;
213
+ declare function canonicalizeWrit(writ: Omit<Writ, 'sig'>): string;
214
+ declare function canonicalizeGrant(grant: Omit<Grant, 'sig'>): string;
215
+
216
+ type NeedlePhase = 'created' | 'validated' | 'executing' | 'observed' | 'stitched' | 'failed';
217
+ interface Needle {
218
+ needle_id: string;
219
+ phase: NeedlePhase;
220
+ tps_coordinate?: string;
221
+ intent: CompiledIntent;
222
+ presence: PresenceReceipt;
223
+ writ: Writ;
224
+ grants: Grant[];
225
+ observation?: AxisObservation;
226
+ receipt?: LoomReceipt;
227
+ verdict?: TruthVerdict;
228
+ created_at: number;
229
+ completed_at?: number;
230
+ error?: NeedleError;
231
+ }
232
+ interface NeedleError {
233
+ phase: NeedlePhase;
234
+ code: string;
235
+ message: string;
236
+ }
237
+ type StitchKind = 'deed' | 'silent' | 'torn';
238
+ interface Stitch {
239
+ stitch_id: string;
240
+ kind: StitchKind;
241
+ intent: string;
242
+ actor_id: string;
243
+ tps_coordinate?: string;
244
+ observation: AxisObservation;
245
+ verdict: TruthVerdict;
246
+ receipt: LoomReceipt;
247
+ thread_id: string;
248
+ sequence: number;
249
+ timeline_event_id?: string;
250
+ stitched_at: number;
251
+ }
252
+ interface Thread {
253
+ state: ThreadState;
254
+ length: number;
255
+ started_at_tps?: string;
256
+ last_stitch_tps?: string;
257
+ has_branches: boolean;
258
+ branch_ids: string[];
259
+ }
260
+
261
+ type NeedleHandler = (intent: CompiledIntent, context: NeedleHandlerContext) => Promise<NeedleHandlerResult>;
262
+ interface NeedleHandlerContext {
263
+ needle_id: string;
264
+ actor_id: string;
265
+ presence_id: string;
266
+ writ: Writ;
267
+ grants: Grant[];
268
+ tps_coordinate?: string;
269
+ }
270
+ interface NeedleHandlerResult {
271
+ ok: boolean;
272
+ effect: string;
273
+ data?: Record<string, unknown>;
274
+ status_code?: number;
275
+ }
276
+ interface NeedlePipelineConfig {
277
+ handlers: Map<string, NeedleHandler>;
278
+ private_key: string;
279
+ public_key: string;
280
+ sensors?: AxisSensor[];
281
+ record_timeline?: boolean;
282
+ tps_provider?: () => string;
283
+ }
284
+ interface NeedlePipelineResult {
285
+ ok: boolean;
286
+ needle: Needle;
287
+ stitch?: Stitch;
288
+ thread_state?: ThreadState;
289
+ timeline_event?: TimelineEvent;
290
+ }
291
+
292
+ declare function assembleNeedle(params: {
293
+ intent: CompiledIntent;
294
+ presence: PresenceReceipt;
295
+ writ: Writ;
296
+ grants: Grant[];
297
+ tps_coordinate?: string;
298
+ }): Needle;
299
+ declare function formStitch(needle: Needle, observation: AxisObservation, verdict: TruthVerdict, receipt: LoomReceipt): Stitch;
300
+ declare function runNeedlePipeline(needle: Needle, config: NeedlePipelineConfig, threadState: ThreadState | null, prevReceipt: LoomReceipt | null, expectedOutcome?: ExpectedOutcome): Promise<NeedlePipelineResult>;
301
+
302
+ type KnotType = 'authority' | 'law' | 'causal' | 'decision' | 'irreversible';
303
+ type KnotStatus = 'open' | 'tied' | 'broken' | 'forked';
304
+ interface Knot {
305
+ knot_id: string;
306
+ type: KnotType;
307
+ status: KnotStatus;
308
+ stitch_ids: string[];
309
+ thread_id: string;
310
+ tps_anchor?: string;
311
+ irreversible: boolean;
312
+ capsule_id?: string;
313
+ law_ref?: string;
314
+ decision_stitch_id?: string;
315
+ branch_ids: string[];
316
+ required_count?: number;
317
+ all_or_nothing: boolean;
318
+ actor_id: string;
319
+ created_at: number;
320
+ tied_at?: number;
321
+ broken_at?: number;
322
+ break_reason?: string;
323
+ witness_hash?: string;
324
+ }
325
+ interface KnotValidationResult {
326
+ valid: boolean;
327
+ passed_stitch_ids: string[];
328
+ failed_stitch_ids: string[];
329
+ can_tie: boolean;
330
+ errors: KnotError[];
331
+ }
332
+ interface KnotError {
333
+ code: string;
334
+ message: string;
335
+ stitch_id?: string;
336
+ }
337
+ interface KnotBreakRequest {
338
+ knot_id: string;
339
+ actor_id: string;
340
+ reason: string;
341
+ override_grant_id?: string;
342
+ signature?: string;
343
+ }
344
+
345
+ interface OpenKnotParams {
346
+ type: KnotType;
347
+ thread_id: string;
348
+ actor_id: string;
349
+ tps_anchor?: string;
350
+ capsule_id?: string;
351
+ law_ref?: string;
352
+ required_count?: number;
353
+ all_or_nothing?: boolean;
354
+ }
355
+ declare function openKnot(params: OpenKnotParams): Knot;
356
+ declare function addStitchToKnot(knot: Knot, stitch: Stitch): string | null;
357
+ declare function validateKnot(knot: Knot, stitches: Stitch[]): KnotValidationResult;
358
+ declare function tieKnot(knot: Knot, stitches: Stitch[]): KnotValidationResult & {
359
+ knot: Knot;
360
+ };
361
+ declare function breakKnot(knot: Knot, request: KnotBreakRequest): {
362
+ ok: boolean;
363
+ error?: string;
364
+ };
365
+ declare function forkFromKnot(knot: Knot, branchId: string, decisionStitchId?: string): {
366
+ ok: boolean;
367
+ error?: string;
368
+ };
369
+ declare function isKnotOpen(knot: Knot): boolean;
370
+ declare function isPointOfNoReturn(knot: Knot): boolean;
371
+ declare function findKnotsForStitch(stitchId: string, knots: Knot[]): Knot[];
372
+ declare function getIrreversibleKnots(knots: Knot[]): Knot[];
373
+ declare function getDecisionPoints(knots: Knot[]): Knot[];
374
+
375
+ interface FabricCell {
376
+ key: string;
377
+ value: unknown;
378
+ last_stitch_id: string;
379
+ last_tps?: string;
380
+ write_count: number;
381
+ locked: boolean;
382
+ locked_by_knot?: string;
383
+ }
384
+ interface Fabric {
385
+ fabric_id: string;
386
+ state_hash: string;
387
+ cells: Map<string, FabricCell>;
388
+ thread_ids: string[];
389
+ stitch_count: number;
390
+ knot_count: number;
391
+ projected_at_tps?: string;
392
+ computed_at: number;
393
+ version: number;
394
+ }
395
+ interface FabricEffect {
396
+ mutations: Record<string, unknown | null>;
397
+ reads?: string[];
398
+ }
399
+ type FabricEffectResolver = (stitch: Stitch) => FabricEffect;
400
+ type FabricDiffKind = 'added' | 'modified' | 'deleted';
401
+ interface FabricDiffEntry {
402
+ key: string;
403
+ kind: FabricDiffKind;
404
+ before?: unknown;
405
+ after?: unknown;
406
+ caused_by_stitch?: string;
407
+ }
408
+ interface FabricDiff {
409
+ from_fabric_id: string;
410
+ to_fabric_id: string;
411
+ entries: FabricDiffEntry[];
412
+ added_count: number;
413
+ modified_count: number;
414
+ deleted_count: number;
415
+ }
416
+ interface FabricQuery {
417
+ prefix?: string;
418
+ keys?: string[];
419
+ actor_id?: string;
420
+ thread_id?: string;
421
+ locked_only?: boolean;
422
+ }
423
+
424
+ declare function createFabric(): Fabric;
425
+ declare function applyStitch(fabric: Fabric, stitch: Stitch, effect: FabricEffect): void;
426
+ declare function weave(stitches: Stitch[], resolver: FabricEffectResolver, knots?: Knot[]): Fabric;
427
+ declare function projectAt(stitches: Stitch[], resolver: FabricEffectResolver, tpsFilter: (tps: string | undefined) => boolean, knots?: Knot[]): Fabric;
428
+ declare function lockCells(fabric: Fabric, keys: string[], knotId: string): void;
429
+ declare function queryFabric(fabric: Fabric, query: FabricQuery): FabricCell[];
430
+ declare function getFabricValue(fabric: Fabric, key: string): unknown | undefined;
431
+ declare function diffFabrics(a: Fabric, b: Fabric): FabricDiff;
432
+
433
+ type PatternKind = 'sequence' | 'knot' | 'state' | 'decision' | 'anomaly';
434
+ type PatternConfidence = number;
435
+ interface Pattern {
436
+ pattern_id: string;
437
+ kind: PatternKind;
438
+ name: string;
439
+ description?: string;
440
+ signature: PatternSignature;
441
+ confidence: PatternConfidence;
442
+ occurrence_count: number;
443
+ first_seen_at: number;
444
+ last_seen_at: number;
445
+ seen_in_threads: string[];
446
+ classification: 'normal' | 'anomalous' | 'unclassified';
447
+ predicted_next?: PatternPrediction;
448
+ }
449
+ interface PatternSignature {
450
+ intent_sequence?: string[];
451
+ stitch_kinds?: StitchKind[];
452
+ knot_type?: KnotType;
453
+ knot_size?: number;
454
+ state_keys?: string[];
455
+ state_mutations?: Record<string, 'created' | 'updated' | 'deleted'>;
456
+ decision_outcome?: string;
457
+ actor?: string;
458
+ min_length?: number;
459
+ max_length?: number;
460
+ }
461
+ interface PatternMatch {
462
+ pattern_id: string;
463
+ matched_stitch_ids: string[];
464
+ matched_knot_ids?: string[];
465
+ match_score: number;
466
+ thread_id: string;
467
+ detected_at: number;
468
+ }
469
+ interface PatternPrediction {
470
+ next_intent: string;
471
+ confidence: PatternConfidence;
472
+ alternatives: Array<{
473
+ intent: string;
474
+ confidence: PatternConfidence;
475
+ }>;
476
+ predicted_outcome?: string;
477
+ risk_note?: string;
478
+ }
479
+ interface PatternStore {
480
+ save(pattern: Pattern): void;
481
+ get(patternId: string): Pattern | undefined;
482
+ findByKind(kind: PatternKind): Pattern[];
483
+ findByIntent(intent: string): Pattern[];
484
+ all(): Pattern[];
485
+ }
486
+
487
+ declare class InMemoryPatternStore implements PatternStore {
488
+ private patterns;
489
+ save(pattern: Pattern): void;
490
+ get(patternId: string): Pattern | undefined;
491
+ findByKind(kind: PatternKind): Pattern[];
492
+ findByIntent(intent: string): Pattern[];
493
+ all(): Pattern[];
494
+ }
495
+ declare function detectSequencePatterns(stitches: Stitch[], windowSize: number, minOccurrences: number): Pattern[];
496
+ declare function detectKnotPatterns(knots: Knot[], minOccurrences: number): Pattern[];
497
+ declare function matchPatterns(stitches: Stitch[], patterns: Pattern[]): PatternMatch[];
498
+ declare function recordOccurrence(pattern: Pattern, threadId: string): void;
499
+ declare function detectAnomalies(recentStitches: Stitch[], knownPatterns: Pattern[], threshold?: number): Pattern[];
500
+
501
+ export { type PatternMatch as $, type AxisObservation as A, type KnotValidationResult as B, type LoomValidationResult as C, type NeedleError as D, type ExpectedOutcome as E, type Fabric as F, type Grant as G, type NeedleHandler as H, InMemoryPatternStore as I, type NeedleHandlerContext as J, type Knot as K, type LoomReceipt as L, type NeedleHandlerResult as M, type Needle as N, type NeedlePhase as O, type PresenceDeclaration as P, type NeedlePipelineConfig as Q, type Revocation as R, type NeedlePipelineResult as S, type ThreadState as T, type ObservationSensor as U, type ObservationStage as V, type WritValidationResult as W, type ObservedDeed as X, type Pattern as Y, type PatternConfidence as Z, type PatternKind as _, type GrantCapability as a, type PatternPrediction as a0, type PatternSignature as a1, type PatternStore as a2, type RevocationTargetType as a3, type Stitch as a4, type StitchKind as a5, type Thread as a6, type TruthStatus as a7, type TruthVerdict as a8, type WritHead as a9, openKnot as aA, projectAt as aB, queryFabric as aC, recordOccurrence as aD, recordSensor as aE, runNeedlePipeline as aF, scoreTruth as aG, startStage as aH, tieKnot as aI, validateKnot as aJ, verifyObservation as aK, weave as aL, type OpenKnotParams as aM, type WritSignature as aa, addStitchToKnot as ab, applyStitch as ac, assembleNeedle as ad, breakKnot as ae, canonicalizeGrant as af, canonicalizeWrit as ag, createFabric as ah, createObservation as ai, deriveAnchorReflection as aj, detectAnomalies as ak, detectKnotPatterns as al, detectSequencePatterns as am, diffFabrics as an, endStage as ao, finalizeObservation as ap, findKnotsForStitch as aq, forkFromKnot as ar, formStitch as as, getDecisionPoints as at, getFabricValue as au, getIrreversibleKnots as av, isKnotOpen as aw, isPointOfNoReturn as ax, lockCells as ay, matchPatterns as az, type PresenceChallenge as b, type Writ as c, type WritBody as d, type WritMeta as e, type PresenceReceipt as f, type GrantStatus as g, type PresenceStatus as h, type PresenceProof as i, type GrantValidationResult as j, type PresenceVerifyResult as k, type Anomaly as l, type AnomalyLevel as m, type FabricCell as n, type FabricDiff as o, type FabricDiffEntry as p, type FabricDiffKind as q, type FabricEffect as r, type FabricEffectResolver as s, type FabricQuery as t, type GrantMeta as u, type GrantType as v, type KnotBreakRequest as w, type KnotError as x, type KnotStatus as y, type KnotType as z };