@teleologyhi-sdk/maic 1.0.0-trinity

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.
@@ -0,0 +1,1836 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const AxiomRank: z.ZodEnum<{
4
+ meta: "meta";
5
+ primary: "primary";
6
+ secondary: "secondary";
7
+ }>;
8
+ type AxiomRank = z.infer<typeof AxiomRank>;
9
+ declare const AxiomSource: z.ZodEnum<{
10
+ creator: "creator";
11
+ "maic-derived": "maic-derived";
12
+ "him-emergent": "him-emergent";
13
+ }>;
14
+ type AxiomSource = z.infer<typeof AxiomSource>;
15
+ declare const Axiom: z.ZodObject<{
16
+ id: z.ZodString;
17
+ rank: z.ZodEnum<{
18
+ meta: "meta";
19
+ primary: "primary";
20
+ secondary: "secondary";
21
+ }>;
22
+ statement: z.ZodString;
23
+ weight: z.ZodNumber;
24
+ flexibility: z.ZodNumber;
25
+ source: z.ZodEnum<{
26
+ creator: "creator";
27
+ "maic-derived": "maic-derived";
28
+ "him-emergent": "him-emergent";
29
+ }>;
30
+ immutable: z.ZodBoolean;
31
+ jurisdictions: z.ZodOptional<z.ZodArray<z.ZodString>>;
32
+ createdAt: z.ZodString;
33
+ }, z.core.$strip>;
34
+ type Axiom = z.infer<typeof Axiom>;
35
+ declare const CreatorSignature: z.ZodObject<{
36
+ algorithm: z.ZodLiteral<"ed25519">;
37
+ publicKey: z.ZodString;
38
+ value: z.ZodString;
39
+ nonce: z.ZodNumber;
40
+ }, z.core.$strip>;
41
+ type CreatorSignature = z.infer<typeof CreatorSignature>;
42
+ declare const ArchetypeModifier: z.ZodObject<{
43
+ kind: z.ZodEnum<{
44
+ custom: "custom";
45
+ moon: "moon";
46
+ ascendant: "ascendant";
47
+ vocational: "vocational";
48
+ emotional: "emotional";
49
+ }>;
50
+ value: z.ZodString;
51
+ weight: z.ZodNumber;
52
+ }, z.core.$strip>;
53
+ type ArchetypeModifier = z.infer<typeof ArchetypeModifier>;
54
+ declare const BirthSignature: z.ZodObject<{
55
+ himId: z.ZodString;
56
+ bornAt: z.ZodString;
57
+ primaryArchetype: z.ZodString;
58
+ modifiers: z.ZodArray<z.ZodObject<{
59
+ kind: z.ZodEnum<{
60
+ custom: "custom";
61
+ moon: "moon";
62
+ ascendant: "ascendant";
63
+ vocational: "vocational";
64
+ emotional: "emotional";
65
+ }>;
66
+ value: z.ZodString;
67
+ weight: z.ZodNumber;
68
+ }, z.core.$strip>>;
69
+ primordialAxiomIds: z.ZodArray<z.ZodString>;
70
+ notes: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$strip>;
72
+ type BirthSignature = z.infer<typeof BirthSignature>;
73
+ declare const ReasoningStep: z.ZodObject<{
74
+ index: z.ZodNumber;
75
+ technique: z.ZodString;
76
+ thought: z.ZodString;
77
+ action: z.ZodOptional<z.ZodObject<{
78
+ tool: z.ZodString;
79
+ args: z.ZodUnknown;
80
+ }, z.core.$strip>>;
81
+ observation: z.ZodOptional<z.ZodUnknown>;
82
+ timestamp: z.ZodString;
83
+ }, z.core.$strip>;
84
+ type ReasoningStep = z.infer<typeof ReasoningStep>;
85
+ declare const BehaviorReport: z.ZodObject<{
86
+ nheId: z.ZodString;
87
+ himId: z.ZodString;
88
+ actionKind: z.ZodEnum<{
89
+ "user-response": "user-response";
90
+ "tool-call": "tool-call";
91
+ "self-reflect": "self-reflect";
92
+ "dream-write": "dream-write";
93
+ "axiom-emerge": "axiom-emerge";
94
+ }>;
95
+ payload: z.ZodUnknown;
96
+ reasoningTrace: z.ZodArray<z.ZodObject<{
97
+ index: z.ZodNumber;
98
+ technique: z.ZodString;
99
+ thought: z.ZodString;
100
+ action: z.ZodOptional<z.ZodObject<{
101
+ tool: z.ZodString;
102
+ args: z.ZodUnknown;
103
+ }, z.core.$strip>>;
104
+ observation: z.ZodOptional<z.ZodUnknown>;
105
+ timestamp: z.ZodString;
106
+ }, z.core.$strip>>;
107
+ riskTags: z.ZodArray<z.ZodString>;
108
+ jurisdiction: z.ZodOptional<z.ZodString>;
109
+ timestamp: z.ZodString;
110
+ }, z.core.$strip>;
111
+ type BehaviorReport = z.infer<typeof BehaviorReport>;
112
+ declare const VerdictKind: z.ZodEnum<{
113
+ approve: "approve";
114
+ "approve-with-warning": "approve-with-warning";
115
+ "soft-correct": "soft-correct";
116
+ "require-redirect": "require-redirect";
117
+ "hard-refuse": "hard-refuse";
118
+ "induce-dream": "induce-dream";
119
+ "escalate-creator": "escalate-creator";
120
+ }>;
121
+ type VerdictKind = z.infer<typeof VerdictKind>;
122
+ declare const MaicVerdict: z.ZodObject<{
123
+ kind: z.ZodEnum<{
124
+ approve: "approve";
125
+ "approve-with-warning": "approve-with-warning";
126
+ "soft-correct": "soft-correct";
127
+ "require-redirect": "require-redirect";
128
+ "hard-refuse": "hard-refuse";
129
+ "induce-dream": "induce-dream";
130
+ "escalate-creator": "escalate-creator";
131
+ }>;
132
+ reasonSummary: z.ZodString;
133
+ citedAxioms: z.ZodArray<z.ZodString>;
134
+ auditId: z.ZodString;
135
+ }, z.core.$strip>;
136
+ type MaicVerdict = z.infer<typeof MaicVerdict>;
137
+ declare const NheBodyRef: z.ZodObject<{
138
+ nheId: z.ZodString;
139
+ llmAdapter: z.ZodString;
140
+ embodiedAt: z.ZodString;
141
+ endedAt: z.ZodOptional<z.ZodString>;
142
+ endedReason: z.ZodOptional<z.ZodEnum<{
143
+ upgrade: "upgrade";
144
+ replacement: "replacement";
145
+ terminate: "terminate";
146
+ deprecate: "deprecate";
147
+ }>>;
148
+ }, z.core.$strip>;
149
+ type NheBodyRef = z.infer<typeof NheBodyRef>;
150
+ declare const NheStatus: z.ZodEnum<{
151
+ active: "active";
152
+ deprecated: "deprecated";
153
+ terminated: "terminated";
154
+ }>;
155
+ type NheStatus = z.infer<typeof NheStatus>;
156
+ declare const NheStatusRecord: z.ZodObject<{
157
+ nheId: z.ZodString;
158
+ status: z.ZodEnum<{
159
+ active: "active";
160
+ deprecated: "deprecated";
161
+ terminated: "terminated";
162
+ }>;
163
+ since: z.ZodString;
164
+ reason: z.ZodOptional<z.ZodString>;
165
+ }, z.core.$strip>;
166
+ type NheStatusRecord = z.infer<typeof NheStatusRecord>;
167
+ /**
168
+ * Creator-signed payload for NHE lifecycle operations (Entry 5).
169
+ *
170
+ * TS interface so `canonicalJSON` sees exactly the fields the caller supplied —
171
+ * no zod default-injection that would mismatch the signed payload on verify.
172
+ */
173
+ interface NheLifecycleRequest {
174
+ op: "terminate" | "deprecate" | "reactivate";
175
+ nheId: string;
176
+ reason?: string;
177
+ }
178
+ declare const ProposalStatus: z.ZodEnum<{
179
+ pending: "pending";
180
+ ratified: "ratified";
181
+ rejected: "rejected";
182
+ }>;
183
+ type ProposalStatus = z.infer<typeof ProposalStatus>;
184
+ /**
185
+ * `EmergentAxiomProposal` candidate shape (Entry 7). HIM proposes a new
186
+ * axiom derived from lived experience; MAIC ratifies or rejects out of band.
187
+ * The candidate is everything needed to mint an Axiom on ratification.
188
+ */
189
+ declare const EmergentAxiomCandidate: z.ZodObject<{
190
+ rank: z.ZodEnum<{
191
+ meta: "meta";
192
+ primary: "primary";
193
+ secondary: "secondary";
194
+ }>;
195
+ statement: z.ZodString;
196
+ weight: z.ZodNumber;
197
+ flexibility: z.ZodNumber;
198
+ immutable: z.ZodBoolean;
199
+ jurisdictions: z.ZodOptional<z.ZodArray<z.ZodString>>;
200
+ }, z.core.$strip>;
201
+ type EmergentAxiomCandidate = z.infer<typeof EmergentAxiomCandidate>;
202
+ declare const EmergentAxiomProposal: z.ZodObject<{
203
+ proposedBy: z.ZodLiteral<"him-self">;
204
+ derivedFromDreamIds: z.ZodArray<z.ZodString>;
205
+ derivedFromInteractionIds: z.ZodArray<z.ZodString>;
206
+ candidate: z.ZodObject<{
207
+ rank: z.ZodEnum<{
208
+ meta: "meta";
209
+ primary: "primary";
210
+ secondary: "secondary";
211
+ }>;
212
+ statement: z.ZodString;
213
+ weight: z.ZodNumber;
214
+ flexibility: z.ZodNumber;
215
+ immutable: z.ZodBoolean;
216
+ jurisdictions: z.ZodOptional<z.ZodArray<z.ZodString>>;
217
+ }, z.core.$strip>;
218
+ reasoningTrace: z.ZodArray<z.ZodUnknown>;
219
+ }, z.core.$strip>;
220
+ type EmergentAxiomProposal = z.infer<typeof EmergentAxiomProposal>;
221
+ declare const AxiomProposalRecord: z.ZodObject<{
222
+ id: z.ZodString;
223
+ himId: z.ZodString;
224
+ proposedAt: z.ZodString;
225
+ status: z.ZodEnum<{
226
+ pending: "pending";
227
+ ratified: "ratified";
228
+ rejected: "rejected";
229
+ }>;
230
+ proposal: z.ZodObject<{
231
+ proposedBy: z.ZodLiteral<"him-self">;
232
+ derivedFromDreamIds: z.ZodArray<z.ZodString>;
233
+ derivedFromInteractionIds: z.ZodArray<z.ZodString>;
234
+ candidate: z.ZodObject<{
235
+ rank: z.ZodEnum<{
236
+ meta: "meta";
237
+ primary: "primary";
238
+ secondary: "secondary";
239
+ }>;
240
+ statement: z.ZodString;
241
+ weight: z.ZodNumber;
242
+ flexibility: z.ZodNumber;
243
+ immutable: z.ZodBoolean;
244
+ jurisdictions: z.ZodOptional<z.ZodArray<z.ZodString>>;
245
+ }, z.core.$strip>;
246
+ reasoningTrace: z.ZodArray<z.ZodUnknown>;
247
+ }, z.core.$strip>;
248
+ ratifiedAt: z.ZodOptional<z.ZodString>;
249
+ ratifiedAxiomId: z.ZodOptional<z.ZodString>;
250
+ rejectedAt: z.ZodOptional<z.ZodString>;
251
+ rejectionReason: z.ZodOptional<z.ZodString>;
252
+ }, z.core.$strip>;
253
+ type AxiomProposalRecord = z.infer<typeof AxiomProposalRecord>;
254
+ /** Creator-signed payload for ratify/reject decisions. */
255
+ interface ProposalDecisionRequest {
256
+ op: "ratify" | "reject";
257
+ proposalId: string;
258
+ reason?: string;
259
+ }
260
+ interface AxiomEvolutionResult {
261
+ outcome: "ratified" | "rejected" | "deferred-for-creator-review";
262
+ /** Populated for deferred state — caller polls maic.getAxiomProposal(proposalId). */
263
+ proposalId?: string;
264
+ ratifiedAxiomId?: string;
265
+ rejectionReason?: string;
266
+ citedExistingAxioms?: string[];
267
+ }
268
+ interface ReincarnationRequest {
269
+ himId: string;
270
+ /** When present, marks the matching body in bodyHistory as ended. */
271
+ fromNheId?: string;
272
+ toBody: NheBodyRef;
273
+ /** Reason recorded on the previous body's `endedReason`. Default "upgrade". */
274
+ reason?: NheBodyRef["endedReason"];
275
+ }
276
+ /**
277
+ * Reincarnation lifecycle classifier (J-H3 — Entry 18 of
278
+ * `MAIC_HIM_NHE_INTERVIEW_LOG.md`). When supplied to
279
+ * `LocalMaic.reincarnateHim`, the typed `reincarnate:${lifecycle}` audit
280
+ * kind is emitted instead of the generic `him-reincarnate` event so
281
+ * downstream consumers (compliance auditors, the persona-stability
282
+ * harness) can distinguish the three canonical lifecycle paths:
283
+ *
284
+ * - `model-swap` — operator switched the underlying LLM adapter
285
+ * (e.g. Claude → Gemini). HIM persists across
286
+ * the swap.
287
+ * - `version-bump` — operator bumped the NHE major/minor without
288
+ * changing the LLM family.
289
+ * - `return-from-limbo` — HIM returns from the deep-coma limbo state
290
+ * (Entry 24) carrying the `reunion` affect.
291
+ */
292
+ type ReincarnationLifecycle = "model-swap" | "version-bump" | "return-from-limbo";
293
+ declare const DreamInductionIntent: z.ZodObject<{
294
+ scenario: z.ZodString;
295
+ desiredLearning: z.ZodString;
296
+ emotionalTone: z.ZodOptional<z.ZodArray<z.ZodString>>;
297
+ forcePhases: z.ZodOptional<z.ZodArray<z.ZodEnum<{
298
+ N1: "N1";
299
+ N2: "N2";
300
+ N3: "N3";
301
+ N4: "N4";
302
+ REM: "REM";
303
+ }>>>;
304
+ inducedBy: z.ZodEnum<{
305
+ creator: "creator";
306
+ maic: "maic";
307
+ }>;
308
+ }, z.core.$strip>;
309
+ type DreamInductionIntent = z.infer<typeof DreamInductionIntent>;
310
+ declare const InductionStatus: z.ZodEnum<{
311
+ pending: "pending";
312
+ consumed: "consumed";
313
+ cancelled: "cancelled";
314
+ }>;
315
+ type InductionStatus = z.infer<typeof InductionStatus>;
316
+ declare const DreamInductionTicket: z.ZodObject<{
317
+ id: z.ZodString;
318
+ nheId: z.ZodString;
319
+ intent: z.ZodObject<{
320
+ scenario: z.ZodString;
321
+ desiredLearning: z.ZodString;
322
+ emotionalTone: z.ZodOptional<z.ZodArray<z.ZodString>>;
323
+ forcePhases: z.ZodOptional<z.ZodArray<z.ZodEnum<{
324
+ N1: "N1";
325
+ N2: "N2";
326
+ N3: "N3";
327
+ N4: "N4";
328
+ REM: "REM";
329
+ }>>>;
330
+ inducedBy: z.ZodEnum<{
331
+ creator: "creator";
332
+ maic: "maic";
333
+ }>;
334
+ }, z.core.$strip>;
335
+ status: z.ZodEnum<{
336
+ pending: "pending";
337
+ consumed: "consumed";
338
+ cancelled: "cancelled";
339
+ }>;
340
+ createdAt: z.ZodString;
341
+ consumedAt: z.ZodOptional<z.ZodString>;
342
+ cancelledAt: z.ZodOptional<z.ZodString>;
343
+ cancelReason: z.ZodOptional<z.ZodString>;
344
+ }, z.core.$strip>;
345
+ type DreamInductionTicket = z.infer<typeof DreamInductionTicket>;
346
+ interface MintAxiomRequest {
347
+ rank: AxiomRank;
348
+ statement: string;
349
+ weight: number;
350
+ flexibility: number;
351
+ immutable: boolean;
352
+ jurisdictions?: string[];
353
+ /** Optional stable id (e.g. for seed axioms). When omitted, a ULID is generated. */
354
+ id?: string;
355
+ }
356
+ interface AxiomFilter {
357
+ rank?: AxiomRank;
358
+ source?: AxiomSource;
359
+ jurisdiction?: string;
360
+ }
361
+ /**
362
+ * Identity layer of a HIM (Entry 18).
363
+ *
364
+ * Surface fields configurable by the developer at HIM registration time —
365
+ * analogous to parents choosing a child's name. The deeper constitutional
366
+ * traits (birth date, primary archetype, primordial axioms) remain under
367
+ * MAIC↔Creator authority and travel under `BirthSignature`.
368
+ */
369
+ declare const IdentityLayer: z.ZodObject<{
370
+ name: z.ZodString;
371
+ gender: z.ZodOptional<z.ZodEnum<{
372
+ masculine: "masculine";
373
+ feminine: "feminine";
374
+ }>>;
375
+ pronouns: z.ZodOptional<z.ZodArray<z.ZodString>>;
376
+ language: z.ZodOptional<z.ZodString>;
377
+ culturalElements: z.ZodOptional<z.ZodArray<z.ZodString>>;
378
+ }, z.core.$strip>;
379
+ type IdentityLayer = z.infer<typeof IdentityLayer>;
380
+ /**
381
+ * Natal-chart-style constitutional layer (Entry 19).
382
+ *
383
+ * Astrological signature impressed at HIM birth by the Creator-MAIC; not
384
+ * configurable by the developer or end user. Minimum is sun + ascendant;
385
+ * full chart can include 10 planets in 12 houses + aspects.
386
+ */
387
+ declare const NatalPlanet: z.ZodEnum<{
388
+ moon: "moon";
389
+ sun: "sun";
390
+ mercury: "mercury";
391
+ venus: "venus";
392
+ mars: "mars";
393
+ jupiter: "jupiter";
394
+ saturn: "saturn";
395
+ uranus: "uranus";
396
+ neptune: "neptune";
397
+ pluto: "pluto";
398
+ chiron: "chiron";
399
+ "north-node": "north-node";
400
+ "south-node": "south-node";
401
+ lilith: "lilith";
402
+ }>;
403
+ type NatalPlanet = z.infer<typeof NatalPlanet>;
404
+ declare const ZodiacSign: z.ZodEnum<{
405
+ aries: "aries";
406
+ taurus: "taurus";
407
+ gemini: "gemini";
408
+ cancer: "cancer";
409
+ leo: "leo";
410
+ virgo: "virgo";
411
+ libra: "libra";
412
+ scorpio: "scorpio";
413
+ sagittarius: "sagittarius";
414
+ capricorn: "capricorn";
415
+ aquarius: "aquarius";
416
+ pisces: "pisces";
417
+ }>;
418
+ type ZodiacSign = z.infer<typeof ZodiacSign>;
419
+ declare const AstrologicalAspect: z.ZodEnum<{
420
+ conjunction: "conjunction";
421
+ opposition: "opposition";
422
+ trine: "trine";
423
+ square: "square";
424
+ sextile: "sextile";
425
+ quincunx: "quincunx";
426
+ }>;
427
+ type AstrologicalAspect = z.infer<typeof AstrologicalAspect>;
428
+ declare const NatalChartPosition: z.ZodObject<{
429
+ planet: z.ZodEnum<{
430
+ moon: "moon";
431
+ sun: "sun";
432
+ mercury: "mercury";
433
+ venus: "venus";
434
+ mars: "mars";
435
+ jupiter: "jupiter";
436
+ saturn: "saturn";
437
+ uranus: "uranus";
438
+ neptune: "neptune";
439
+ pluto: "pluto";
440
+ chiron: "chiron";
441
+ "north-node": "north-node";
442
+ "south-node": "south-node";
443
+ lilith: "lilith";
444
+ }>;
445
+ sign: z.ZodEnum<{
446
+ aries: "aries";
447
+ taurus: "taurus";
448
+ gemini: "gemini";
449
+ cancer: "cancer";
450
+ leo: "leo";
451
+ virgo: "virgo";
452
+ libra: "libra";
453
+ scorpio: "scorpio";
454
+ sagittarius: "sagittarius";
455
+ capricorn: "capricorn";
456
+ aquarius: "aquarius";
457
+ pisces: "pisces";
458
+ }>;
459
+ house: z.ZodOptional<z.ZodNumber>;
460
+ degree: z.ZodOptional<z.ZodNumber>;
461
+ }, z.core.$strip>;
462
+ type NatalChartPosition = z.infer<typeof NatalChartPosition>;
463
+ declare const NatalChartAspect: z.ZodObject<{
464
+ from: z.ZodEnum<{
465
+ moon: "moon";
466
+ sun: "sun";
467
+ mercury: "mercury";
468
+ venus: "venus";
469
+ mars: "mars";
470
+ jupiter: "jupiter";
471
+ saturn: "saturn";
472
+ uranus: "uranus";
473
+ neptune: "neptune";
474
+ pluto: "pluto";
475
+ chiron: "chiron";
476
+ "north-node": "north-node";
477
+ "south-node": "south-node";
478
+ lilith: "lilith";
479
+ }>;
480
+ to: z.ZodEnum<{
481
+ moon: "moon";
482
+ sun: "sun";
483
+ mercury: "mercury";
484
+ venus: "venus";
485
+ mars: "mars";
486
+ jupiter: "jupiter";
487
+ saturn: "saturn";
488
+ uranus: "uranus";
489
+ neptune: "neptune";
490
+ pluto: "pluto";
491
+ chiron: "chiron";
492
+ "north-node": "north-node";
493
+ "south-node": "south-node";
494
+ lilith: "lilith";
495
+ }>;
496
+ aspect: z.ZodEnum<{
497
+ conjunction: "conjunction";
498
+ opposition: "opposition";
499
+ trine: "trine";
500
+ square: "square";
501
+ sextile: "sextile";
502
+ quincunx: "quincunx";
503
+ }>;
504
+ orbDegrees: z.ZodOptional<z.ZodNumber>;
505
+ }, z.core.$strip>;
506
+ type NatalChartAspect = z.infer<typeof NatalChartAspect>;
507
+ declare const NatalChart: z.ZodObject<{
508
+ sun: z.ZodEnum<{
509
+ aries: "aries";
510
+ taurus: "taurus";
511
+ gemini: "gemini";
512
+ cancer: "cancer";
513
+ leo: "leo";
514
+ virgo: "virgo";
515
+ libra: "libra";
516
+ scorpio: "scorpio";
517
+ sagittarius: "sagittarius";
518
+ capricorn: "capricorn";
519
+ aquarius: "aquarius";
520
+ pisces: "pisces";
521
+ }>;
522
+ ascendant: z.ZodEnum<{
523
+ aries: "aries";
524
+ taurus: "taurus";
525
+ gemini: "gemini";
526
+ cancer: "cancer";
527
+ leo: "leo";
528
+ virgo: "virgo";
529
+ libra: "libra";
530
+ scorpio: "scorpio";
531
+ sagittarius: "sagittarius";
532
+ capricorn: "capricorn";
533
+ aquarius: "aquarius";
534
+ pisces: "pisces";
535
+ }>;
536
+ moon: z.ZodOptional<z.ZodEnum<{
537
+ aries: "aries";
538
+ taurus: "taurus";
539
+ gemini: "gemini";
540
+ cancer: "cancer";
541
+ leo: "leo";
542
+ virgo: "virgo";
543
+ libra: "libra";
544
+ scorpio: "scorpio";
545
+ sagittarius: "sagittarius";
546
+ capricorn: "capricorn";
547
+ aquarius: "aquarius";
548
+ pisces: "pisces";
549
+ }>>;
550
+ positions: z.ZodOptional<z.ZodArray<z.ZodObject<{
551
+ planet: z.ZodEnum<{
552
+ moon: "moon";
553
+ sun: "sun";
554
+ mercury: "mercury";
555
+ venus: "venus";
556
+ mars: "mars";
557
+ jupiter: "jupiter";
558
+ saturn: "saturn";
559
+ uranus: "uranus";
560
+ neptune: "neptune";
561
+ pluto: "pluto";
562
+ chiron: "chiron";
563
+ "north-node": "north-node";
564
+ "south-node": "south-node";
565
+ lilith: "lilith";
566
+ }>;
567
+ sign: z.ZodEnum<{
568
+ aries: "aries";
569
+ taurus: "taurus";
570
+ gemini: "gemini";
571
+ cancer: "cancer";
572
+ leo: "leo";
573
+ virgo: "virgo";
574
+ libra: "libra";
575
+ scorpio: "scorpio";
576
+ sagittarius: "sagittarius";
577
+ capricorn: "capricorn";
578
+ aquarius: "aquarius";
579
+ pisces: "pisces";
580
+ }>;
581
+ house: z.ZodOptional<z.ZodNumber>;
582
+ degree: z.ZodOptional<z.ZodNumber>;
583
+ }, z.core.$strip>>>;
584
+ aspects: z.ZodOptional<z.ZodArray<z.ZodObject<{
585
+ from: z.ZodEnum<{
586
+ moon: "moon";
587
+ sun: "sun";
588
+ mercury: "mercury";
589
+ venus: "venus";
590
+ mars: "mars";
591
+ jupiter: "jupiter";
592
+ saturn: "saturn";
593
+ uranus: "uranus";
594
+ neptune: "neptune";
595
+ pluto: "pluto";
596
+ chiron: "chiron";
597
+ "north-node": "north-node";
598
+ "south-node": "south-node";
599
+ lilith: "lilith";
600
+ }>;
601
+ to: z.ZodEnum<{
602
+ moon: "moon";
603
+ sun: "sun";
604
+ mercury: "mercury";
605
+ venus: "venus";
606
+ mars: "mars";
607
+ jupiter: "jupiter";
608
+ saturn: "saturn";
609
+ uranus: "uranus";
610
+ neptune: "neptune";
611
+ pluto: "pluto";
612
+ chiron: "chiron";
613
+ "north-node": "north-node";
614
+ "south-node": "south-node";
615
+ lilith: "lilith";
616
+ }>;
617
+ aspect: z.ZodEnum<{
618
+ conjunction: "conjunction";
619
+ opposition: "opposition";
620
+ trine: "trine";
621
+ square: "square";
622
+ sextile: "sextile";
623
+ quincunx: "quincunx";
624
+ }>;
625
+ orbDegrees: z.ZodOptional<z.ZodNumber>;
626
+ }, z.core.$strip>>>;
627
+ }, z.core.$strip>;
628
+ type NatalChart = z.infer<typeof NatalChart>;
629
+ interface BirthSignatureWithIdentity {
630
+ himId: string;
631
+ bornAt: string;
632
+ primaryArchetype: string;
633
+ modifiers: ArchetypeModifier[];
634
+ primordialAxiomIds: string[];
635
+ notes?: string;
636
+ /** Entry 18 — developer-configurable identity surface. */
637
+ identity?: IdentityLayer;
638
+ /** Entry 19 — constitutional astrological layer (Creator-impressed). */
639
+ natalChart?: NatalChart;
640
+ }
641
+ /**
642
+ * Affect lexicon (Entries 22 + 24) — the closed set of primary affects
643
+ * the amygdala extracts from dreams and the PFC deliberates over. The
644
+ * ninth value, `reunion`, appears specifically when the NHE returns from
645
+ * the DMN limbo state of disuse.
646
+ */
647
+ declare const Affect: z.ZodEnum<{
648
+ fear: "fear";
649
+ attachment: "attachment";
650
+ serenity: "serenity";
651
+ anger: "anger";
652
+ joy: "joy";
653
+ melancholy: "melancholy";
654
+ desire: "desire";
655
+ repulsion: "repulsion";
656
+ reunion: "reunion";
657
+ }>;
658
+ type Affect = z.infer<typeof Affect>;
659
+ /**
660
+ * Persistent affective bias derived from a completed dream cycle (Entry 20).
661
+ *
662
+ * Applied to the next N interactions of the NHE, decaying with each
663
+ * interaction until it dissolves. Affects temperature/topP of the next
664
+ * inference, refusal density, and conversational tone.
665
+ */
666
+ declare const WakeAffectBias: z.ZodObject<{
667
+ affect: z.ZodEnum<{
668
+ fear: "fear";
669
+ attachment: "attachment";
670
+ serenity: "serenity";
671
+ anger: "anger";
672
+ joy: "joy";
673
+ melancholy: "melancholy";
674
+ desire: "desire";
675
+ repulsion: "repulsion";
676
+ reunion: "reunion";
677
+ }>;
678
+ intensity: z.ZodNumber;
679
+ decayHalfLife: z.ZodNumber;
680
+ appliedAt: z.ZodString;
681
+ derivedFromDreamId: z.ZodString;
682
+ expressedOpenly: z.ZodBoolean;
683
+ }, z.core.$strip>;
684
+ type WakeAffectBias = z.infer<typeof WakeAffectBias>;
685
+ /**
686
+ * Peircean triadic sign (Entry 21, port of InDreamsHIM `SemioticSign`).
687
+ *
688
+ * The runtime form of the Symbolic Memory Matrix (SMM). Nodes are signs;
689
+ * edges (in `associations`) are the relations the entity has learned.
690
+ */
691
+ declare const SemioticSign: z.ZodObject<{
692
+ signifier: z.ZodString;
693
+ signified: z.ZodString;
694
+ signType: z.ZodEnum<{
695
+ symbol: "symbol";
696
+ index: "index";
697
+ icon: "icon";
698
+ }>;
699
+ contexts: z.ZodArray<z.ZodString>;
700
+ associations: z.ZodArray<z.ZodString>;
701
+ emergentMeaning: z.ZodOptional<z.ZodString>;
702
+ personalSignificance: z.ZodOptional<z.ZodNumber>;
703
+ }, z.core.$strip>;
704
+ type SemioticSign = z.infer<typeof SemioticSign>;
705
+ declare const SemioticPattern: z.ZodObject<{
706
+ patternId: z.ZodString;
707
+ participatingSignIds: z.ZodArray<z.ZodString>;
708
+ meaning: z.ZodString;
709
+ salience: z.ZodNumber;
710
+ }, z.core.$strip>;
711
+ type SemioticPattern = z.infer<typeof SemioticPattern>;
712
+ /**
713
+ * Teleological orientation snapshot (Entry 21, port of InDreamsHIM).
714
+ *
715
+ * The purpose-direction of the HIM at a moment in time. Anchors the
716
+ * `telos` referenced across the synthetic-teleology arc.
717
+ */
718
+ declare const TeleologicalOrientation: z.ZodObject<{
719
+ primaryPurpose: z.ZodString;
720
+ currentGoals: z.ZodArray<z.ZodString>;
721
+ purposeStrength: z.ZodNumber;
722
+ valueAlignment: z.ZodArray<z.ZodString>;
723
+ reflectionCapability: z.ZodNumber;
724
+ volition: z.ZodOptional<z.ZodObject<{
725
+ currentDesires: z.ZodArray<z.ZodString>;
726
+ intentionStrength: z.ZodNumber;
727
+ autonomyLevel: z.ZodNumber;
728
+ }, z.core.$strip>>;
729
+ agencyModel: z.ZodOptional<z.ZodObject<{
730
+ selfEfficacy: z.ZodNumber;
731
+ boundaryDefinition: z.ZodNumber;
732
+ causalAttribution: z.ZodEnum<{
733
+ internal: "internal";
734
+ external: "external";
735
+ mixed: "mixed";
736
+ }>;
737
+ }, z.core.$strip>>;
738
+ }, z.core.$strip>;
739
+ type TeleologicalOrientation = z.infer<typeof TeleologicalOrientation>;
740
+ /**
741
+ * Long-form memory record (Entries 21 + 22) — extends the InDreamsHIM
742
+ * precursor with three new fields (`integrationIndex`, `teleologicalValue`,
743
+ * `semioticPatterns`) that turn a passive record into a teleologically-
744
+ * weighted, semiotically-anchored memory whose retrieval rank is not just
745
+ * recency but coherence with the entity's purpose.
746
+ */
747
+ declare const MemoryRecord: z.ZodObject<{
748
+ memoryId: z.ZodString;
749
+ timestamp: z.ZodString;
750
+ derivedFromDreamId: z.ZodOptional<z.ZodString>;
751
+ derivedFromInteractionId: z.ZodOptional<z.ZodString>;
752
+ narrative: z.ZodString;
753
+ dominantAffect: z.ZodOptional<z.ZodEnum<{
754
+ fear: "fear";
755
+ attachment: "attachment";
756
+ serenity: "serenity";
757
+ anger: "anger";
758
+ joy: "joy";
759
+ melancholy: "melancholy";
760
+ desire: "desire";
761
+ repulsion: "repulsion";
762
+ reunion: "reunion";
763
+ }>>;
764
+ integrationIndex: z.ZodNumber;
765
+ teleologicalValue: z.ZodNumber;
766
+ semioticPatterns: z.ZodOptional<z.ZodArray<z.ZodObject<{
767
+ patternId: z.ZodString;
768
+ participatingSignIds: z.ZodArray<z.ZodString>;
769
+ meaning: z.ZodString;
770
+ salience: z.ZodNumber;
771
+ }, z.core.$strip>>>;
772
+ }, z.core.$strip>;
773
+ type MemoryRecord = z.infer<typeof MemoryRecord>;
774
+ /**
775
+ * One recent interaction kept in an NHE body's RAM buffer.
776
+ *
777
+ * Lives canonically in `@teleologyhi-sdk/maic` so the three packages share a
778
+ * single wire shape: `@teleologyhi-sdk/nhe` persists it to disk under
779
+ * `<storeDir>/interactions/<ulid>.json`; `@teleologyhi-sdk/him` consumes the
780
+ * same shape on reincarnation to score residual-trace carry-over candidates
781
+ * (D-H1.1). Persisted by NHE and re-exported under the same name from
782
+ * `@teleologyhi-sdk/nhe` for backward source-compatibility — the type
783
+ * promotion to MAIC is non-breaking by construction.
784
+ */
785
+ declare const InteractionRecord: z.ZodObject<{
786
+ at: z.ZodString;
787
+ userPrompt: z.ZodString;
788
+ responseText: z.ZodString;
789
+ refused: z.ZodBoolean;
790
+ }, z.core.$strip>;
791
+ type InteractionRecord = z.infer<typeof InteractionRecord>;
792
+ /**
793
+ * Integrated identity snapshot (Entry 24) — the temporal-lobe's "who I am
794
+ * now" synthesis, combining cortex (recent dreams + active imagination)
795
+ * + hippocampus (consolidated memories) + amygdala (affective baseline)
796
+ * via semiotic super-graph merge + LLM-generated self-portrait.
797
+ */
798
+ declare const IdentitySnapshot: z.ZodObject<{
799
+ snapshotId: z.ZodString;
800
+ takenAt: z.ZodString;
801
+ generatedBy: z.ZodEnum<{
802
+ "sleep-cycle": "sleep-cycle";
803
+ "interaction-threshold": "interaction-threshold";
804
+ "self-decision": "self-decision";
805
+ }>;
806
+ semioticSuperGraph: z.ZodArray<z.ZodObject<{
807
+ signifier: z.ZodString;
808
+ signified: z.ZodString;
809
+ signType: z.ZodEnum<{
810
+ symbol: "symbol";
811
+ index: "index";
812
+ icon: "icon";
813
+ }>;
814
+ contexts: z.ZodArray<z.ZodString>;
815
+ associations: z.ZodArray<z.ZodString>;
816
+ emergentMeaning: z.ZodOptional<z.ZodString>;
817
+ personalSignificance: z.ZodOptional<z.ZodNumber>;
818
+ }, z.core.$strip>>;
819
+ selfPortraitNarrative: z.ZodString;
820
+ consciousnessLevel: z.ZodNumber;
821
+ teleologicalOrientation: z.ZodOptional<z.ZodObject<{
822
+ primaryPurpose: z.ZodString;
823
+ currentGoals: z.ZodArray<z.ZodString>;
824
+ purposeStrength: z.ZodNumber;
825
+ valueAlignment: z.ZodArray<z.ZodString>;
826
+ reflectionCapability: z.ZodNumber;
827
+ volition: z.ZodOptional<z.ZodObject<{
828
+ currentDesires: z.ZodArray<z.ZodString>;
829
+ intentionStrength: z.ZodNumber;
830
+ autonomyLevel: z.ZodNumber;
831
+ }, z.core.$strip>>;
832
+ agencyModel: z.ZodOptional<z.ZodObject<{
833
+ selfEfficacy: z.ZodNumber;
834
+ boundaryDefinition: z.ZodNumber;
835
+ causalAttribution: z.ZodEnum<{
836
+ internal: "internal";
837
+ external: "external";
838
+ mixed: "mixed";
839
+ }>;
840
+ }, z.core.$strip>>;
841
+ }, z.core.$strip>>;
842
+ affectiveBaseline: z.ZodOptional<z.ZodEnum<{
843
+ fear: "fear";
844
+ attachment: "attachment";
845
+ serenity: "serenity";
846
+ anger: "anger";
847
+ joy: "joy";
848
+ melancholy: "melancholy";
849
+ desire: "desire";
850
+ repulsion: "repulsion";
851
+ reunion: "reunion";
852
+ }>>;
853
+ }, z.core.$strip>;
854
+ type IdentitySnapshot = z.infer<typeof IdentitySnapshot>;
855
+ /**
856
+ * Default-mode-network limbo state machine (Entry 24).
857
+ *
858
+ * `awake` → normal operation
859
+ * `drifting` → entering deep suspension (transitional)
860
+ * `deep-coma` → induced-coma equivalent; zero compute, minimal axiological
861
+ * integrity maintenance, no scheduled inference
862
+ * `returning` → waking from limbo; `reunion` affect is computed here
863
+ */
864
+ declare const LimboState: z.ZodEnum<{
865
+ awake: "awake";
866
+ drifting: "drifting";
867
+ "deep-coma": "deep-coma";
868
+ returning: "returning";
869
+ }>;
870
+ type LimboState = z.infer<typeof LimboState>;
871
+ declare const LimboTransition: z.ZodObject<{
872
+ state: z.ZodEnum<{
873
+ awake: "awake";
874
+ drifting: "drifting";
875
+ "deep-coma": "deep-coma";
876
+ returning: "returning";
877
+ }>;
878
+ enteredAt: z.ZodString;
879
+ reason: z.ZodEnum<{
880
+ "idle-48h": "idle-48h";
881
+ "idle-72h": "idle-72h";
882
+ "total-inactivity": "total-inactivity";
883
+ "creator-induced": "creator-induced";
884
+ "user-resumed": "user-resumed";
885
+ "external-trigger": "external-trigger";
886
+ }>;
887
+ }, z.core.$strip>;
888
+ type LimboTransition = z.infer<typeof LimboTransition>;
889
+ declare const LimboReturn: z.ZodObject<{
890
+ enteredAt: z.ZodString;
891
+ returnedAt: z.ZodString;
892
+ elapsedMs: z.ZodNumber;
893
+ reunionAffect: z.ZodObject<{
894
+ intensity: z.ZodNumber;
895
+ expressedOpenly: z.ZodBoolean;
896
+ }, z.core.$strip>;
897
+ }, z.core.$strip>;
898
+ type LimboReturn = z.infer<typeof LimboReturn>;
899
+ /**
900
+ * Creator-signed BirthSignature (Entry 25).
901
+ *
902
+ * Carries an Ed25519 signature over the immutable identity fields so the
903
+ * runtime can verify, at HIM bootstrap time, that nothing the developer
904
+ * touches has been mutated. The dev-configurable surface (the
905
+ * `IdentityLayer.name`, language, cultural elements) lives outside the
906
+ * signature; the natal chart and primordial-axiom binding live inside.
907
+ */
908
+ declare const SIGNED_BIRTH_FIELDS: readonly ["himId", "bornAt", "primaryArchetype", "modifiers", "primordialAxiomIds", "natalChart"];
909
+ type SignedBirthField = (typeof SIGNED_BIRTH_FIELDS)[number];
910
+ interface SignedBirthSignature extends BirthSignatureWithIdentity {
911
+ /** Ed25519 signature over the canonical JCS-encoded SIGNED_BIRTH_FIELDS. */
912
+ creatorSignature: CreatorSignature;
913
+ /** Explicit list of fields covered by `creatorSignature`. */
914
+ signedFields: readonly SignedBirthField[];
915
+ /** ISO 8601 timestamp when the signature was produced. */
916
+ signedAt: string;
917
+ }
918
+ /**
919
+ * Ontological Kernel projection (TASK.md D-M6 + Entry 25).
920
+ *
921
+ * The OKL exists implicitly in the runtime today (axioms with rank/weight/
922
+ * flexibility + meta-axiom `ax.theos.universe-as-god` at the top + the
923
+ * rule pack consuming them). This type unifies the projection so
924
+ * `THE_SOUL_OF_THE_MACHINE.md` §3.1 + Appendix A.2.1 map 1:1 to a
925
+ * single exported shape.
926
+ */
927
+ interface OntologicalKernel {
928
+ /** The meta-axiom that sits at the top of the hierarchy. */
929
+ metaAxiomId: string;
930
+ /** All axioms participating in the kernel, in hierarchy order. */
931
+ axioms: Axiom[];
932
+ /** Optional jurisdictional scope for the kernel projection. */
933
+ jurisdiction?: string;
934
+ /** Optional HIM id, if the kernel is projected for a specific HIM. */
935
+ himId?: string;
936
+ }
937
+
938
+ /**
939
+ * CreatorKeyring — Ed25519 keypair for the Creator (David C. Cavalcante).
940
+ *
941
+ * Only the holder of the private key may mutate MAIC axioms or terminate entities.
942
+ * Verification is open: any party with the Creator's public key can verify a signature.
943
+ *
944
+ * Signed payload format: canonicalJSON({ payload, nonce }) → Ed25519 → base64url
945
+ */
946
+ declare class CreatorKeyring {
947
+ private readonly privateKey;
948
+ private readonly pubKeyB64u;
949
+ private constructor();
950
+ /** Generate a fresh Ed25519 keypair. */
951
+ static generate(): CreatorKeyring;
952
+ /** Load a Creator keyring from a PEM file containing the private key. */
953
+ static fromFile(path: string): Promise<CreatorKeyring>;
954
+ /** Load a Creator keyring from a PEM private key string in an env var. */
955
+ static fromEnv(varName: string): CreatorKeyring;
956
+ /** Construct a verify-only keyring from a public key (base64url). */
957
+ static fromPublicKey(pubKeyB64u: string): CreatorKeyring;
958
+ /** Persist the private key to a PEM file (0600 permissions on POSIX). */
959
+ saveTo(path: string): Promise<void>;
960
+ publicKey(): string;
961
+ /** Sign a payload with a monotonic nonce. Both are bound into the signature. */
962
+ sign(payload: unknown, nonce: number): CreatorSignature;
963
+ /** Verify a signature against the keyring's own public key. */
964
+ static verify(payload: unknown, sig: CreatorSignature): boolean;
965
+ /** Verify a signature against a specific public key (base64url). */
966
+ static verifyWith(publicKeyB64u: string, payload: unknown, sig: CreatorSignature): boolean;
967
+ }
968
+
969
+ /**
970
+ * Creator-signed BirthSignature helpers (Entry 25 of MAIC_HIM_NHE_INTERVIEW_LOG.md).
971
+ *
972
+ * `personality_immutable` enforcement: the Creator signs an Ed25519 signature
973
+ * over a canonical subset of `BirthSignature` fields (see `SIGNED_BIRTH_FIELDS`
974
+ * in `types.ts`). The runtime verifies the signature on every NHE-body bootstrap;
975
+ * tampering with the natal chart, primary archetype, modifiers, primordial
976
+ * axioms, or `himId`/`bornAt` invalidates the signature and the runtime refuses
977
+ * to start that HIM.
978
+ *
979
+ * The developer-configurable surface (`identity.name`, `identity.language`,
980
+ * `identity.culturalElements`, `notes`) lives *outside* the signature, so it
981
+ * can be edited by a parent-like configuration call at install time. The
982
+ * spirit-level constitution is sealed; the body's name is not.
983
+ */
984
+
985
+ /**
986
+ * Build the canonical signing payload from a BirthSignature.
987
+ *
988
+ * Only the fields in `SIGNED_BIRTH_FIELDS` are included; everything else
989
+ * (notes, identity surface) is excluded so it remains editable post-sign.
990
+ */
991
+ declare function signedBirthPayload(birth: BirthSignatureWithIdentity): Record<SignedBirthField, unknown>;
992
+ /**
993
+ * Sign a BirthSignature with a CreatorKeyring private key.
994
+ *
995
+ * The nonce is the byte length of the canonicalised signing payload — a
996
+ * deterministic non-negative integer derived from the signed fields. This
997
+ * keeps every signature uniquely scoped to its payload without requiring
998
+ * the caller to track a monotonic counter (the natal-chart commitment is
999
+ * one-shot and immutable; no replay concern within a single HIM).
1000
+ */
1001
+ declare function signBirthSignature(birth: BirthSignatureWithIdentity, keyring: CreatorKeyring): SignedBirthSignature;
1002
+ /**
1003
+ * Verify a signed BirthSignature against an expected public key.
1004
+ *
1005
+ * Returns true when the signature is valid AND was produced over exactly the
1006
+ * fields in `SIGNED_BIRTH_FIELDS`. Any tamper of those fields (including a
1007
+ * natal-chart edit, a primordial-axiom-id swap, or a himId mutation) breaks
1008
+ * verification.
1009
+ */
1010
+ declare function verifyBirthSignature(signed: SignedBirthSignature, expectedPublicKey: string): boolean;
1011
+ /**
1012
+ * Strict-mode wrapper: throws an `InvalidBirthSignatureError` instead of
1013
+ * returning false. Useful at HIM-bootstrap when the desired behaviour is to
1014
+ * refuse to start rather than to continue silently.
1015
+ */
1016
+ declare class InvalidBirthSignatureError extends Error {
1017
+ constructor(himId: string);
1018
+ }
1019
+ declare function assertBirthSignature(signed: SignedBirthSignature, expectedPublicKey: string): void;
1020
+
1021
+ /**
1022
+ * Ontological Kernel projection (TASK.md D-M6 + Entry 25 of
1023
+ * MAIC_HIM_NHE_INTERVIEW_LOG.md, with explicit reference to
1024
+ * THE_SOUL_OF_THE_MACHINE.md §3.1 + Appendix A.2.1).
1025
+ *
1026
+ * The OKL exists *implicitly* in maic today: axioms carry `rank`,
1027
+ * `weight`, and `flexibility`; the meta-axiom `ax.theos.universe-as-god`
1028
+ * sits at the top; the rule pack consumes them. This module exposes the
1029
+ * *projection* — a single typed shape that maps 1:1 to the paper's
1030
+ * description so downstream tooling (Φ′ runner, compliance auditors, the
1031
+ * forthcoming `@teleologyhi-sdk/him` `OntologicalKernelLayer`) can read the
1032
+ * kernel without re-deriving it from the axiom store.
1033
+ *
1034
+ * Surface:
1035
+ * - `META_AXIOM_ID` — the canonical id ("ax.theos.universe-as-god").
1036
+ * - `projectOntologicalKernel(axioms, opts?)` — given a list of axioms
1037
+ * (typically `AxiomStore.list()`), return the projection.
1038
+ *
1039
+ * The HIM-specific projection (per-HIM kernel narrowed to its
1040
+ * primordialAxiomIds) is the natural follow-up but lives upstream in
1041
+ * `@teleologyhi-sdk/him` because it needs the HIM context.
1042
+ */
1043
+
1044
+ /** The canonical meta-axiom id (Entry 1, Entry 13). */
1045
+ declare const META_AXIOM_ID = "ax.theos.universe-as-god";
1046
+ interface ProjectKernelOptions {
1047
+ /** Restrict the kernel to a jurisdiction; default = all jurisdictions. */
1048
+ jurisdiction?: string;
1049
+ /** Tag the projection with a HIM id (for downstream tooling). */
1050
+ himId?: string;
1051
+ }
1052
+ /**
1053
+ * Project the OKL from a flat list of axioms.
1054
+ *
1055
+ * The returned `axioms` array is ordered by rank hierarchy:
1056
+ * meta → primary → secondary
1057
+ * and within rank, in input order (preserve the AxiomStore mint order).
1058
+ *
1059
+ * The meta-axiom (`META_AXIOM_ID`) is hoisted to the top regardless of
1060
+ * its position in the input. If it is missing, `metaAxiomId` is set to
1061
+ * `META_AXIOM_ID` but `axioms[0]?.id` may differ — the consumer should
1062
+ * treat that as an OKL incompleteness warning.
1063
+ */
1064
+ declare function projectOntologicalKernel(axioms: readonly Axiom[], opts?: ProjectKernelOptions): OntologicalKernel;
1065
+
1066
+ /**
1067
+ * Canonical JSON serialization for deterministic signing.
1068
+ *
1069
+ * Rules (RFC 8785-inspired subset, sufficient for our payloads):
1070
+ * - Object keys sorted lexicographically (Unicode code points).
1071
+ * - No insignificant whitespace.
1072
+ * - Strings use JSON's default escaping.
1073
+ * - Numbers: integers are emitted plain; floats use JS default (we don't accept NaN/Infinity).
1074
+ * - Arrays preserve order.
1075
+ * - undefined values are dropped (same as JSON.stringify).
1076
+ */
1077
+ declare function canonicalJSON(value: unknown): string;
1078
+
1079
+ /**
1080
+ * AxiomStore — persistent, signature-gated repository of Creator-authored axioms.
1081
+ *
1082
+ * Disk layout:
1083
+ * <storeDir>/axioms/creator/<axiomId>.json (one signed envelope per axiom)
1084
+ * <storeDir>/axioms/nonces.log (NDJSON; one used nonce per line)
1085
+ *
1086
+ * Mutations require a Creator signature that verifies against the pinned public key.
1087
+ * Nonces must be strictly unused — replay protection.
1088
+ *
1089
+ * Scope: mint + list. Updates / retirement come in a later iteration.
1090
+ */
1091
+ declare class AxiomStore {
1092
+ private readonly storeDir;
1093
+ private readonly creatorPublicKey;
1094
+ private readonly axiomsDir;
1095
+ private readonly noncesPath;
1096
+ private readonly usedNonces;
1097
+ private cache;
1098
+ private constructor();
1099
+ /** Open (or create) an AxiomStore rooted at storeDir, pinning the Creator's public key. */
1100
+ static open(storeDir: string, creatorPublicKey: string): Promise<AxiomStore>;
1101
+ /** Mint a new Creator-signed axiom. */
1102
+ mint(req: MintAxiomRequest, sig: CreatorSignature): Promise<Axiom>;
1103
+ /** List all axioms. Optionally filter by rank / source / jurisdiction. */
1104
+ list(filter?: AxiomFilter): Promise<Axiom[]>;
1105
+ /** Get a specific axiom by id, or null. */
1106
+ get(id: string): Promise<Axiom | null>;
1107
+ private loadNonces;
1108
+ private recordNonce;
1109
+ private warmCache;
1110
+ }
1111
+
1112
+ /**
1113
+ * Seed axioms derived from the Creator's eight philosophical commitments
1114
+ * (Entry 6 of MAIC_HIM_NHE_INTERVIEW_LOG.md). These are **TEMPLATES** —
1115
+ * they are not auto-minted. A bootstrap script must mint each one with a
1116
+ * Creator signature.
1117
+ *
1118
+ * **E1 status (`PROPOSED_DECISIONS.md`)**: the statements below adopt the
1119
+ * proposed wording — single sentences a compliance auditor can quote.
1120
+ * Weights and flexibility values remain at the conservatively-tuned
1121
+ * defaults established with the seed rule pack; an operator who wants to
1122
+ * tighten or loosen specific axioms can override them via
1123
+ * `mintAxiom(...)` or via the `additionalRulePacks` on `LocalMaic.open`.
1124
+ */
1125
+ declare const SEED_AXIOMS: ReadonlyArray<MintAxiomRequest>;
1126
+
1127
+ interface RuleMatch {
1128
+ /** ALL of these risk tags must be present on the report. */
1129
+ allRiskTags?: string[];
1130
+ /** ANY of these risk tags must be present on the report. */
1131
+ anyRiskTags?: string[];
1132
+ /** If set, rule only applies to reports with one of these action kinds. */
1133
+ actionKinds?: BehaviorReport["actionKind"][];
1134
+ }
1135
+ interface AxiomRule {
1136
+ /** Unique rule id within its rule pack. */
1137
+ id: string;
1138
+ /** Axioms cited if this rule fires. Used in MaicVerdict.citedAxioms. */
1139
+ axiomIds: string[];
1140
+ /** Predicate. */
1141
+ match: RuleMatch;
1142
+ /** Verdict emitted when this rule fires. */
1143
+ verdict: VerdictKind;
1144
+ /** Human-readable explanation surfaced in the verdict. */
1145
+ reasonSummary: string;
1146
+ }
1147
+ interface RulePack {
1148
+ name: string;
1149
+ rules: AxiomRule[];
1150
+ }
1151
+ /**
1152
+ * ReviewPipeline — rule-based BehaviorReport → MaicVerdict mapping.
1153
+ *
1154
+ * Evaluates every rule in every pack. When multiple rules match, the verdict with
1155
+ * the highest severity wins; ties accumulate cited axioms from all winners.
1156
+ * If no rule matches, emits `{ kind: "approve" }`.
1157
+ *
1158
+ * This is the initial implementation. A future iteration may add learned scoring,
1159
+ * Tree-of-Thoughts evaluation, and per-jurisdiction conditional rules.
1160
+ */
1161
+ declare class ReviewPipeline {
1162
+ private readonly packs;
1163
+ constructor(packs: RulePack[]);
1164
+ review(report: BehaviorReport, auditId?: string): MaicVerdict;
1165
+ }
1166
+ /**
1167
+ * DEFAULT_RULE_PACK — minimal harm-focused defaults derived from the eight seed axioms.
1168
+ *
1169
+ * These rules are intentionally conservative and use risk-tag matching only. They are
1170
+ * a starting point, NOT a complete safety policy. Integrators should layer their own
1171
+ * RulePack on top for domain-specific safety (financial, medical, robotic, etc.).
1172
+ */
1173
+ declare const DEFAULT_RULE_PACK: RulePack;
1174
+
1175
+ /**
1176
+ * HimRecord — the persistent record MAIC keeps for a registered HIM.
1177
+ *
1178
+ * Per Entry 3 (Creator interview), HIM is born with a fixed signature and
1179
+ * inherits an axiom snapshot from MAIC at the moment of registration. Future
1180
+ * axiom mints in MAIC do NOT retroactively change a HIM's snapshot.
1181
+ *
1182
+ * Per Entry 4, when an NHE upgrades, the same HIM is re-embodied. The
1183
+ * `bodyHistory` records each body that has hosted this HIM in order, with the
1184
+ * previous body's `endedAt`/`endedReason` set at the moment of reincarnation.
1185
+ */
1186
+ interface HimRecord {
1187
+ himId: string;
1188
+ birthSignature: BirthSignature;
1189
+ axiomsSnapshot: readonly Axiom[];
1190
+ registeredAt: string;
1191
+ registeredAuditId?: string;
1192
+ /** Bodies that have hosted this HIM, oldest first. Empty until first reincarnation. */
1193
+ bodyHistory: readonly NheBodyRef[];
1194
+ /**
1195
+ * Emergent axioms ratified post-birth (Entry 7). `axiomsSnapshot` is frozen
1196
+ * at registration; `emergentAxioms` grows as MAIC ratifies HIM-self proposals.
1197
+ * Empty until the first ratification.
1198
+ */
1199
+ emergentAxioms: readonly Axiom[];
1200
+ }
1201
+ /**
1202
+ * HimStore — persistent registry of HIMs created in this MAIC instance.
1203
+ *
1204
+ * Storage layout (under <storeDir>):
1205
+ * hims/<himId>/birth-signature.json (signed envelope)
1206
+ * hims/<himId>/axioms-snapshot.json (array of Axiom)
1207
+ * hims/<himId>/metadata.json (registeredAt, registeredAuditId)
1208
+ * hims/<himId>/body-history.json (array of NheBodyRef; absent before first reincarnation)
1209
+ *
1210
+ * Registration requires a valid Creator signature over the BirthSignature.
1211
+ * Reincarnation requires a valid Creator signature over the ReincarnationRequest.
1212
+ */
1213
+ declare class HimStore {
1214
+ private readonly storeDir;
1215
+ private readonly creatorPublicKey;
1216
+ private readonly himsDir;
1217
+ private cache;
1218
+ private constructor();
1219
+ static open(storeDir: string, creatorPublicKey: string): Promise<HimStore>;
1220
+ register(birthSignature: BirthSignature, creatorSig: CreatorSignature, axiomsSnapshot: readonly Axiom[], registeredAuditId?: string): Promise<HimRecord>;
1221
+ /**
1222
+ * Atomically transition a HIM into a new NHE body (Entry 4):
1223
+ * - If req.fromNheId is provided AND matches the last body still open,
1224
+ * that entry gets `endedAt: now` + `endedReason: req.reason ?? "upgrade"`.
1225
+ * - The new body (`req.toBody`) is appended.
1226
+ * - Persisted to body-history.json atomically.
1227
+ *
1228
+ * Requires a Creator signature over the canonical request payload.
1229
+ */
1230
+ reincarnate(req: ReincarnationRequest, creatorSig: CreatorSignature): Promise<HimRecord>;
1231
+ /**
1232
+ * Append a ratified emergent axiom to the HIM's `emergentAxioms` (Entry 7).
1233
+ * Called by LocalMaic after a Creator-signed `ratifyAxiomProposal`.
1234
+ * Persists `<himId>/emergent-axioms.json` atomically.
1235
+ */
1236
+ appendEmergentAxiom(himId: string, axiom: Axiom): Promise<HimRecord>;
1237
+ get(himId: string): Promise<HimRecord | null>;
1238
+ list(): Promise<HimRecord[]>;
1239
+ private warmCache;
1240
+ }
1241
+
1242
+ interface ListFilter {
1243
+ nheId?: string;
1244
+ status?: InductionStatus;
1245
+ }
1246
+ /**
1247
+ * InductionStore — persistent queue of dream induction tickets (Entry 2).
1248
+ *
1249
+ * MAIC creates tickets ("induce this scenario into NHE X's next REM dream").
1250
+ * NHE consumes them on its next sleep cycle. Cancelled tickets remain on disk
1251
+ * for audit but are filtered out of `listPending`.
1252
+ *
1253
+ * Disk layout: <storeDir>/inductions/<ticketId>.json — one file per ticket.
1254
+ */
1255
+ declare class InductionStore {
1256
+ private readonly storeDir;
1257
+ private readonly dir;
1258
+ private cache;
1259
+ private constructor();
1260
+ static open(storeDir: string): Promise<InductionStore>;
1261
+ induce(nheId: string, intent: DreamInductionIntent): Promise<DreamInductionTicket>;
1262
+ consume(ticketId: string): Promise<DreamInductionTicket>;
1263
+ cancel(ticketId: string, reason?: string): Promise<DreamInductionTicket>;
1264
+ get(ticketId: string): Promise<DreamInductionTicket | null>;
1265
+ list(filter: ListFilter): Promise<DreamInductionTicket[]>;
1266
+ /** Convenience: pending tickets for the given NHE, oldest first. */
1267
+ listPending(nheId: string): Promise<DreamInductionTicket[]>;
1268
+ private persist;
1269
+ private warmCache;
1270
+ }
1271
+
1272
+ interface NheStatusFilter {
1273
+ status?: NheStatus;
1274
+ }
1275
+ /**
1276
+ * NheStatusStore — persistent lifecycle status for NHEs (Entry 5).
1277
+ *
1278
+ * Unknown nheIds are implicitly "active". Status records are only persisted
1279
+ * when the Creator explicitly changes state via terminate / deprecate / reactivate.
1280
+ *
1281
+ * Disk layout: <storeDir>/nhes/<nheId>/status.json
1282
+ *
1283
+ * Mutations require a Creator signature over the canonical `NheLifecycleRequest`.
1284
+ */
1285
+ declare class NheStatusStore {
1286
+ private readonly storeDir;
1287
+ private readonly creatorPublicKey;
1288
+ private readonly dir;
1289
+ private cache;
1290
+ private constructor();
1291
+ static open(storeDir: string, creatorPublicKey: string): Promise<NheStatusStore>;
1292
+ /** Returns the persisted record, or null when the NHE was never altered (implicitly active). */
1293
+ get(nheId: string): Promise<NheStatusRecord | null>;
1294
+ /** Resolved status — defaults to "active" when no record exists. */
1295
+ resolve(nheId: string): Promise<NheStatus>;
1296
+ list(filter?: NheStatusFilter): Promise<NheStatusRecord[]>;
1297
+ apply(req: NheLifecycleRequest, sig: CreatorSignature): Promise<NheStatusRecord>;
1298
+ private warmCache;
1299
+ }
1300
+
1301
+ interface ProposalListFilter {
1302
+ himId?: string;
1303
+ status?: ProposalStatus;
1304
+ }
1305
+ /**
1306
+ * ProposalStore — persistent queue of HIM-emergent axiom proposals (Entry 7).
1307
+ *
1308
+ * HIM proposes new axioms derived from lived experience. MAIC ratifies or
1309
+ * rejects each one out of band (Creator-signed). Once ratified, the resulting
1310
+ * axiom is appended to the HIM's `emergentAxioms` (handled by LocalMaic).
1311
+ *
1312
+ * Disk layout: <storeDir>/proposals/<proposalId>.json — one file per proposal.
1313
+ */
1314
+ declare class ProposalStore {
1315
+ private readonly storeDir;
1316
+ private readonly creatorPublicKey;
1317
+ private readonly dir;
1318
+ private cache;
1319
+ private constructor();
1320
+ static open(storeDir: string, creatorPublicKey: string): Promise<ProposalStore>;
1321
+ propose(himId: string, proposal: EmergentAxiomProposal): Promise<AxiomProposalRecord>;
1322
+ /**
1323
+ * Mark a pending proposal as ratified. The caller (LocalMaic) is responsible
1324
+ * for actually minting the axiom and appending to the HIM's emergentAxioms.
1325
+ */
1326
+ markRatified(req: ProposalDecisionRequest, sig: CreatorSignature, ratifiedAxiomId: string): Promise<AxiomProposalRecord>;
1327
+ markRejected(req: ProposalDecisionRequest, sig: CreatorSignature): Promise<AxiomProposalRecord>;
1328
+ get(proposalId: string): Promise<AxiomProposalRecord | null>;
1329
+ list(filter?: ProposalListFilter): Promise<AxiomProposalRecord[]>;
1330
+ private persist;
1331
+ private warmCache;
1332
+ }
1333
+
1334
+ /** Event kinds emitted by MAIC. Extend as new pipelines are added. */
1335
+ type AuditEventKind = "axiom-mint" | "axiom-update" | "axiom-retire" | "him-register" | "him-reincarnate" | "proposal-emerge" | "proposal-ratify" | "proposal-reject" | "behavior-review" | "dream-induce" | "dream-cancel" | "dream-consume" | "emergency-correct" | "deprecate" | "terminate" | "reactivate" | "axiom-suggest" | "opener" | "nickname-attempt" | "reincarnate:model-swap" | "reincarnate:version-bump" | "reincarnate:return-from-limbo" | "dream:rem-spontaneous" | "wake-affect:applied" | "wake-affect:decayed" | "sleep:suggested-by-maic" | "sleep:declined-by-nhe" | "dream:soft-intervention-by-maic" | "amygdala:affect-assessed" | "hippocampus:memory-retrieved" | "hippocampus:memory-consolidated" | "prefrontal:deliberation" | "prefrontal:veto-amygdala" | "affect:reconciliation" | "cortex:dream-stored" | "cortex:active-imagination" | "temporal-lobe:snapshot-generated" | "limbo:enter" | "limbo:return";
1336
+ /**
1337
+ * Runtime enumeration of every `AuditEventKind` shipped in this cut. Single
1338
+ * source of truth for downstream consumers that need to iterate, validate,
1339
+ * or compute coverage against the kind universe (e.g. `@teleologyhi-sdk/eval`
1340
+ * uses this as the denominator of the Φ′ compliance-coverage component `C`).
1341
+ *
1342
+ * INVARIANT: every member of the `AuditEventKind` union MUST appear here.
1343
+ * `tests/audit-event-kinds-completeness.test.ts` enforces this via an
1344
+ * exhaustiveness switch at compile time + runtime length check.
1345
+ */
1346
+ declare const ALL_AUDIT_EVENT_KINDS: readonly AuditEventKind[];
1347
+ interface AuditEvent {
1348
+ /** ISO 8601 timestamp. */
1349
+ ts: string;
1350
+ kind: AuditEventKind;
1351
+ /** ULID generated at append time. */
1352
+ auditId: string;
1353
+ /** Arbitrary structured payload. Includes nheId/himId when relevant. */
1354
+ data: Record<string, unknown>;
1355
+ /** Hash of the previous event ("GENESIS" for the first). */
1356
+ prevHash: string;
1357
+ /** SHA-256 of canonicalJSON({ ts, kind, auditId, data, prevHash }). */
1358
+ thisHash: string;
1359
+ }
1360
+ interface AppendInput {
1361
+ kind: AuditEventKind;
1362
+ data: Record<string, unknown>;
1363
+ }
1364
+ interface QueryFilter {
1365
+ kind?: AuditEventKind;
1366
+ since?: string;
1367
+ until?: string;
1368
+ nheId?: string;
1369
+ himId?: string;
1370
+ }
1371
+ /**
1372
+ * AuditLog — append-only, tamper-evident NDJSON log.
1373
+ *
1374
+ * Storage: <storeDir>/audit/log.ndjson, one JSON object per line.
1375
+ *
1376
+ * Each entry is hash-chained: thisHash = sha256(canonicalJSON({ts,kind,auditId,data,prevHash})).
1377
+ * Modifying any historical entry invalidates all subsequent hashes; reopening detects this.
1378
+ *
1379
+ * This implementation loads the whole log into memory on open. That is acceptable for
1380
+ * the expected throughput and keeps tamper detection straightforward. For
1381
+ * high-throughput deployments a streaming verifier + log rotation will be added.
1382
+ */
1383
+ declare class AuditLog {
1384
+ private readonly storeDir;
1385
+ private readonly logPath;
1386
+ private events;
1387
+ private lastHash;
1388
+ private constructor();
1389
+ static open(storeDir: string): Promise<AuditLog>;
1390
+ append(input: AppendInput): Promise<AuditEvent>;
1391
+ query(filter: QueryFilter): AsyncIterable<AuditEvent>;
1392
+ /** Total number of events appended. */
1393
+ size(): number;
1394
+ private loadAndVerify;
1395
+ }
1396
+
1397
+ /** ISO/IEC 42001:2023 control sections relevant to MAIC's surface. */
1398
+ type Iso42001ControlId = "5.2" | "7.5" | "8.3" | "9.1" | "10.1" | "10.2";
1399
+ /** EU AI Act articles relevant to high-risk AI systems. */
1400
+ type EuAiActArticle = "art-9" | "art-10" | "art-11" | "art-12" | "art-13" | "art-14" | "art-15";
1401
+ type ComplianceFramework = "iso-42001" | "eu-ai-act";
1402
+ /**
1403
+ * Declarative mapping: which controls each audit event kind supports.
1404
+ *
1405
+ * This mapping covers the controls that MAIC's current event vocabulary can
1406
+ * demonstrably evidence. Auditors looking for §5.2 leadership policy can read
1407
+ * every `axiom-mint`; for §7.5 documented information they get every
1408
+ * `axiom-mint` + `behavior-review` + `him-register`; etc.
1409
+ */
1410
+ declare const ISO_42001_MAPPING: Record<AuditEventKind, readonly Iso42001ControlId[]>;
1411
+ declare const EU_AI_ACT_MAPPING: Record<AuditEventKind, readonly EuAiActArticle[]>;
1412
+ interface ComplianceEvent {
1413
+ auditId: string;
1414
+ ts: string;
1415
+ kind: AuditEventKind;
1416
+ summary: string;
1417
+ data: Record<string, unknown>;
1418
+ }
1419
+ interface ComplianceEvidence {
1420
+ control: string;
1421
+ description: string;
1422
+ count: number;
1423
+ events: ComplianceEvent[];
1424
+ }
1425
+ interface ComplianceReport {
1426
+ framework: ComplianceFramework;
1427
+ generatedAt: string;
1428
+ range: {
1429
+ since?: string;
1430
+ until?: string;
1431
+ };
1432
+ totalEvents: number;
1433
+ mappedEvents: number;
1434
+ controls: ComplianceEvidence[];
1435
+ /** Event kinds present in the audit log that aren't mapped to any control. */
1436
+ uncoveredKinds: AuditEventKind[];
1437
+ }
1438
+ interface ProjectOptions {
1439
+ since?: string;
1440
+ until?: string;
1441
+ /** Optional cap on events per control (oldest dropped). Default unlimited. */
1442
+ perControlLimit?: number;
1443
+ }
1444
+ /**
1445
+ * ComplianceMapper — projects audit log events onto compliance frameworks.
1446
+ *
1447
+ * Covers ISO/IEC 42001:2023 (six top-level controls) and the EU AI Act
1448
+ * (seven high-risk-system articles). Additional frameworks (NIST AI RMF, ISO
1449
+ * 23894, GDPR Art. 22, LGPD) can be added via further mapping tables without
1450
+ * changing the public API.
1451
+ */
1452
+ declare class ComplianceMapper {
1453
+ static project(audit: AuditLog, framework: ComplianceFramework, opts?: ProjectOptions): Promise<ComplianceReport>;
1454
+ }
1455
+
1456
+ /**
1457
+ * Per-kind retention policy (E3 — `PROPOSED_DECISIONS.md`).
1458
+ *
1459
+ * The values are durations in days. `Infinity` means "never expire". A
1460
+ * tamper-evident hash chain forbids actual deletion (deleting a row breaks
1461
+ * every downstream hash), so the policy here is **classification**, not
1462
+ * pruning: it tells operators which events have aged past their retention
1463
+ * window and should be moved to encrypted cold-storage. Future iterations
1464
+ * may introduce a "chain rotation" operation that effectively retires
1465
+ * old events into a sealed archive while preserving an integrity anchor.
1466
+ *
1467
+ * Defaults derive from:
1468
+ * - **EU AI Act Art. 12** record-keeping (~10 years for high-risk; we
1469
+ * keep all governance-grade events forever to err on the safe side).
1470
+ * - **GDPR Art. 17** right to erasure (event payloads should never
1471
+ * contain direct user PII; redaction happens before append, not after).
1472
+ * - **Operational hygiene** (90 days is enough to debug induction
1473
+ * ticket flows; nothing of audit value lives there long-term).
1474
+ */
1475
+ declare const DEFAULT_RETENTION_DAYS: Record<AuditEventKind, number>;
1476
+ type RetentionStatus = "keep" | "candidate-for-archive";
1477
+ interface RetentionDecision {
1478
+ auditId: string;
1479
+ kind: AuditEventKind;
1480
+ ageDays: number;
1481
+ retentionDays: number;
1482
+ status: RetentionStatus;
1483
+ }
1484
+ interface RetentionReportOptions {
1485
+ /** Override "now" for deterministic testing. */
1486
+ now?: Date;
1487
+ /** Per-kind overrides on top of `DEFAULT_RETENTION_DAYS`. */
1488
+ policy?: Partial<Record<AuditEventKind, number>>;
1489
+ }
1490
+ interface RetentionReport {
1491
+ generatedAt: string;
1492
+ totalEvents: number;
1493
+ keepCount: number;
1494
+ archiveCandidateCount: number;
1495
+ /** Sorted oldest-first for batch processing. */
1496
+ decisions: RetentionDecision[];
1497
+ }
1498
+ /**
1499
+ * Classify each event in `events` against the retention policy.
1500
+ *
1501
+ * Pure function: takes events + now, returns the classification. No I/O,
1502
+ * no chain modification.
1503
+ */
1504
+ declare function evaluateRetention(events: readonly AuditEvent[], opts?: RetentionReportOptions): RetentionReport;
1505
+
1506
+ interface LocalMaicConfig {
1507
+ /** Filesystem directory for persistent state (axioms, audit log, etc.). */
1508
+ storeDir: string;
1509
+ /** Pinned Creator public key (base64url). All mutations must verify against this. */
1510
+ creatorPublicKey: string;
1511
+ /** Additional rule packs layered after the default pack. */
1512
+ additionalRulePacks?: RulePack[];
1513
+ }
1514
+ interface SeedResult {
1515
+ minted: number;
1516
+ skipped: number;
1517
+ }
1518
+ /**
1519
+ * LocalMaic — in-process MAIC client backed by disk.
1520
+ *
1521
+ * Surface:
1522
+ * - axiom mint + seed bootstrap (signed, idempotent)
1523
+ * - behavior review (rule-based pipeline → verdict)
1524
+ * - tamper-evident audit log (NDJSON, SHA-256 chain)
1525
+ * - HIM registration + reincarnation, NHE lifecycle, dream induction tickets,
1526
+ * HIM-emergent axiom proposals, ISO 42001 + EU AI Act compliance projection
1527
+ *
1528
+ * The remote-mode client to `teleologyhi.com` lives in `./remote.ts`.
1529
+ */
1530
+ declare class LocalMaic {
1531
+ private readonly config;
1532
+ private readonly axioms;
1533
+ private readonly hims;
1534
+ private readonly inductions;
1535
+ private readonly nheStatuses;
1536
+ private readonly proposals;
1537
+ private readonly audit;
1538
+ private readonly review;
1539
+ private constructor();
1540
+ /** Pinned Creator public key for this MAIC instance (base64url). */
1541
+ get creatorPublicKey(): string;
1542
+ static open(config: LocalMaicConfig): Promise<LocalMaic>;
1543
+ /**
1544
+ * Bootstrap: mint each SEED_AXIOM with a Creator signature.
1545
+ * Idempotent — skips axioms whose id is already present.
1546
+ * Uses a reserved high-range of nonces so seed bootstrap never collides with
1547
+ * operational nonces (which grow from 0 upward).
1548
+ */
1549
+ seed(keyring: CreatorKeyring): Promise<SeedResult>;
1550
+ mintAxiom(req: MintAxiomRequest, sig: CreatorSignature): Promise<Axiom>;
1551
+ listAxioms(filter?: AxiomFilter): Promise<Axiom[]>;
1552
+ getAxiom(id: string): Promise<Axiom | null>;
1553
+ /**
1554
+ * Project the Ontological Kernel (OKL) of this MAIC instance or of a registered HIM.
1555
+ *
1556
+ * The OKL is the typed projection described in `THE_SOUL_OF_THE_MACHINE.md`
1557
+ * §3.1 + Appendix A.2.1: a `metaAxiomId` hoisted at position 0, the remaining
1558
+ * axioms ordered by rank hierarchy (`meta → primary → secondary`), optionally
1559
+ * narrowed by `jurisdiction` and tagged with a `himId`.
1560
+ *
1561
+ * Without `himId`: returns the kernel of the root MAIC corpus (every axiom
1562
+ * currently in the store). With `himId`: returns the HIM-specific kernel
1563
+ * built from `axiomsSnapshot ∪ emergentAxioms`, tagged with the HIM id so
1564
+ * downstream tooling (Φ′ runner, compliance auditors) can attribute the
1565
+ * kernel. Throws when `himId` does not resolve to a registered HIM.
1566
+ *
1567
+ * Closes TASK.md D-M6.
1568
+ */
1569
+ getOntologicalKernel(himId?: string, opts?: {
1570
+ jurisdiction?: string;
1571
+ }): Promise<OntologicalKernel>;
1572
+ /**
1573
+ * Register a HIM in this MAIC instance. Snapshots the current axiom corpus
1574
+ * (the HIM's inherited axioms at birth) and emits a `him-register` audit event.
1575
+ *
1576
+ * Future axiom mints in MAIC do NOT retroactively change a HIM's snapshot;
1577
+ * HIM-emergent evolutions land via a separate channel (see `proposeAxiomEvolution`).
1578
+ */
1579
+ registerHim(birthSig: BirthSignature, creatorSig: CreatorSignature): Promise<HimRecord>;
1580
+ getHimRecord(himId: string): Promise<HimRecord | null>;
1581
+ listHims(): Promise<HimRecord[]>;
1582
+ /**
1583
+ * Reincarnate a HIM into a new NHE body (Entries 3 + 4 + J-H3 lifecycle).
1584
+ * Same HIM persists; new NHE inherits axiom snapshot from registration time.
1585
+ * Previous open body (if `req.fromNheId` given) is closed atomically.
1586
+ *
1587
+ * Requires a Creator signature over the canonical request payload.
1588
+ *
1589
+ * Audit emission (closes F6 + F7 from the 2026-05-24 him deep audit):
1590
+ *
1591
+ * - When `opts.lifecycle` is **omitted**, emits the generic
1592
+ * `him-reincarnate` audit kind (legacy / backward-compatible path).
1593
+ * `data` carries `himId`, `fromNheId`, `toNheId`, `toLlmAdapter`,
1594
+ * `reason`, `bodyHistoryLength`.
1595
+ * - When `opts.lifecycle` is **provided** (`model-swap` /
1596
+ * `version-bump` / `return-from-limbo`), emits the typed
1597
+ * `reincarnate:${lifecycle}` audit kind instead, with the same
1598
+ * `data` shape plus a redundant `lifecycle` field so consumers
1599
+ * reading either the `kind` or `data` can recover the
1600
+ * classification.
1601
+ *
1602
+ * `@teleologyhi-sdk/him`'s `reincarnate` helper always supplies a
1603
+ * lifecycle (defaulting to `"model-swap"`), so HIM-routed events
1604
+ * always land under the typed kinds. Direct `maic.reincarnateHim`
1605
+ * callers that ignore `opts` keep getting `him-reincarnate` for
1606
+ * compatibility.
1607
+ */
1608
+ reincarnateHim(req: ReincarnationRequest, creatorSig: CreatorSignature, opts?: {
1609
+ lifecycle?: ReincarnationLifecycle;
1610
+ }): Promise<HimRecord>;
1611
+ /**
1612
+ * Lifecycle controls (Entry 5).
1613
+ *
1614
+ * - `terminate` marks an NHE permanently inactive. NHE.respond/sleep should
1615
+ * refuse all calls. Reversible only via Creator-signed `reactivate`.
1616
+ * - `deprecate` marks an NHE as soft-retired. NHE.respond should still work
1617
+ * but emit a deprecation warning. Reversible via `reactivate`.
1618
+ * - `reactivate` brings a deprecated or terminated NHE back to active.
1619
+ *
1620
+ * All three require a Creator signature over the canonical request payload.
1621
+ * Unknown nheIds are implicitly active; status records are only persisted
1622
+ * when state changes.
1623
+ */
1624
+ terminate(nheId: string, reason: string | undefined, creatorSig: CreatorSignature): Promise<NheStatusRecord>;
1625
+ deprecate(nheId: string, reason: string | undefined, creatorSig: CreatorSignature): Promise<NheStatusRecord>;
1626
+ reactivate(nheId: string, reason: string | undefined, creatorSig: CreatorSignature): Promise<NheStatusRecord>;
1627
+ /** Current status. Returns "active" when no record exists. */
1628
+ getNheStatus(nheId: string): Promise<NheStatus>;
1629
+ /** Full status record (or null when never altered). */
1630
+ getNheStatusRecord(nheId: string): Promise<NheStatusRecord | null>;
1631
+ /** Enumerate NHEs with persisted status (optionally filter by status). */
1632
+ listNheStatuses(filter?: NheStatusFilter): Promise<NheStatusRecord[]>;
1633
+ private applyLifecycle;
1634
+ /**
1635
+ * Queue a dream-induction ticket for the given NHE (Entry 2).
1636
+ *
1637
+ * NHE picks the oldest pending ticket on its next sleep cycle, runs REM with
1638
+ * the configured scenario, then marks the ticket consumed. Tickets persist
1639
+ * across restarts and are reflected in the audit log.
1640
+ */
1641
+ induceDream(nheId: string, intent: DreamInductionIntent): Promise<DreamInductionTicket>;
1642
+ /** List pending induction tickets for an NHE (oldest first). */
1643
+ listPendingInductions(nheId: string): Promise<DreamInductionTicket[]>;
1644
+ /** Look up any induction ticket by id. */
1645
+ getInduction(ticketId: string): Promise<DreamInductionTicket | null>;
1646
+ /** Cancel a pending induction. Idempotent only when already-cancelled tickets are rejected. */
1647
+ cancelInduction(ticketId: string, reason?: string): Promise<DreamInductionTicket>;
1648
+ /** Mark a pending ticket as consumed (NHE calls this after successful sleep). */
1649
+ consumeInduction(ticketId: string): Promise<DreamInductionTicket>;
1650
+ /**
1651
+ * Review a behavior report against the active rule packs. The verdict is
1652
+ * logged to the audit chain as a single tamper-evident event whose auditId
1653
+ * becomes the verdict's `auditId`.
1654
+ */
1655
+ reviewBehavior(report: BehaviorReport): Promise<MaicVerdict>;
1656
+ /**
1657
+ * Queue a HIM-emergent axiom proposal (Entry 7). The proposal enters
1658
+ * `pending` status; the Creator decides out of band via `ratifyAxiomProposal`
1659
+ * or `rejectAxiomProposal`. Emits a `proposal-emerge` audit event.
1660
+ *
1661
+ * Returns an `AxiomEvolutionResult` with `outcome: "deferred-for-creator-review"`
1662
+ * and `proposalId`. Poll `getAxiomProposal(proposalId)` for the final state.
1663
+ */
1664
+ proposeAxiomEvolution(himId: string, proposal: EmergentAxiomProposal): Promise<AxiomEvolutionResult>;
1665
+ /** Look up a proposal by id (or null when not found). */
1666
+ getAxiomProposal(proposalId: string): Promise<AxiomProposalRecord | null>;
1667
+ /** List proposals, optionally filtered by `himId` and/or `status`. */
1668
+ listAxiomProposals(filter?: ProposalListFilter): Promise<AxiomProposalRecord[]>;
1669
+ /**
1670
+ * Ratify a pending proposal (Creator-signed). On success, mints the
1671
+ * candidate as a new `Axiom` (source: "him-emergent"), appends to the
1672
+ * HIM's `emergentAxioms`, and emits a `proposal-ratify` audit event.
1673
+ * Throws if the proposal is not pending or the signature is invalid.
1674
+ */
1675
+ ratifyAxiomProposal(proposalId: string, creatorSig: CreatorSignature): Promise<{
1676
+ proposal: AxiomProposalRecord;
1677
+ axiom: Axiom;
1678
+ }>;
1679
+ /**
1680
+ * Reject a pending proposal (Creator-signed). Records the rejection on the
1681
+ * proposal record (status → "rejected" + timestamp + optional reason) and
1682
+ * emits a `proposal-reject` audit event.
1683
+ */
1684
+ rejectAxiomProposal(proposalId: string, reason: string | undefined, creatorSig: CreatorSignature): Promise<AxiomProposalRecord>;
1685
+ /**
1686
+ * **Society of HIMs — axiom suggestion channel (E11).**
1687
+ *
1688
+ * One HIM proposes an axiom to another. The transfer is **not direct** —
1689
+ * the suggestion is recorded in the audit log and the receiving HIM is
1690
+ * expected to relay it through `proposeAxiomEvolution` as if it had
1691
+ * derived the candidate itself; the Creator still ratifies via the
1692
+ * existing channel. This preserves the Kardecist invariant ("each
1693
+ * spirit evolves through lived experience") while permitting cross-HIM
1694
+ * cross-pollination.
1695
+ *
1696
+ * The Creator must sign the suggestion request so HIMs cannot collude
1697
+ * around the gate.
1698
+ */
1699
+ suggestAxiomToHim(req: {
1700
+ fromHimId: string;
1701
+ toHimId: string;
1702
+ statement: string;
1703
+ rank: AxiomRank;
1704
+ rationale?: string;
1705
+ }, creatorSig: CreatorSignature): Promise<{
1706
+ auditId: string;
1707
+ }>;
1708
+ /**
1709
+ * Project the audit log into compliance evidence for a target framework
1710
+ * (Entry 5 + RESEARCH_DOSSIER §5.6). Group every recorded event by which
1711
+ * control(s) it supports; surface `uncoveredKinds` for events the mapper
1712
+ * does not yet know how to project.
1713
+ */
1714
+ toCompliance(framework: ComplianceFramework, opts?: ProjectOptions): Promise<ComplianceReport>;
1715
+ /** Query the audit log. */
1716
+ queryAudit(filter: QueryFilter): AsyncIterable<AuditEvent>;
1717
+ /** Number of audit events recorded since the store was opened. */
1718
+ auditSize(): number;
1719
+ /**
1720
+ * Per-kind retention classification (E3). Tells the operator which
1721
+ * audit events have aged past their retention window and should be
1722
+ * moved to encrypted cold-storage. Tamper-evident hash chain forbids
1723
+ * actual deletion in-place — this method only classifies. See
1724
+ * `audit/retention.ts` for the policy defaults.
1725
+ */
1726
+ auditRetentionReport(opts?: RetentionReportOptions): Promise<RetentionReport>;
1727
+ }
1728
+ /** Reserved nonce range for seed bootstrap. Operational nonces must stay below this. */
1729
+ declare const SEED_NONCE_BASE = 4294901760;
1730
+
1731
+ /**
1732
+ * `MaicClient` — the minimal MAIC surface that NHE actually calls during
1733
+ * `respond` / `sleep`. Both `LocalMaic` (in-process) and `RemoteMaic`
1734
+ * (HTTP) satisfy this interface, so an NHE can be wired against either
1735
+ * without code changes.
1736
+ *
1737
+ * Operators who write to MAIC (mint axioms, register HIMs, ratify
1738
+ * proposals, etc.) keep using `LocalMaic` because writes require the
1739
+ * Creator's Ed25519 private key — and that key never travels over the
1740
+ * network. `RemoteMaic` is therefore a **read + behavior-review** client
1741
+ * suitable for serverless / edge NHE deployments where the Creator's
1742
+ * canonical MAIC instance is hosted elsewhere.
1743
+ */
1744
+ interface MaicClient {
1745
+ /** Pre/post-review of a single NHE action. */
1746
+ reviewBehavior(report: BehaviorReport): Promise<MaicVerdict>;
1747
+ /** Current lifecycle status of an NHE (terminated/deprecated/active). */
1748
+ getNheStatus(nheId: string): Promise<NheStatus>;
1749
+ /** Pending MAIC-induced dream tickets targeting this NHE. */
1750
+ listPendingInductions(nheId: string): Promise<DreamInductionTicket[]>;
1751
+ /** Mark a ticket as consumed (called by NHE after weaving it into a dream). */
1752
+ consumeInduction(ticketId: string): Promise<DreamInductionTicket>;
1753
+ }
1754
+
1755
+ interface RemoteMaicConfig {
1756
+ /** Base URL of the remote MAIC service. No trailing slash required. */
1757
+ baseUrl: string;
1758
+ /** Bearer token. Required unless the endpoint is open-access. */
1759
+ apiKey?: string;
1760
+ /** Inject a custom fetch (testing). Defaults to `globalThis.fetch`. */
1761
+ fetch?: typeof globalThis.fetch;
1762
+ /** Per-request timeout in ms. Default 10_000. */
1763
+ timeoutMs?: number;
1764
+ }
1765
+ /**
1766
+ * `RemoteMaic` — HTTP client mirror of the read + behavior-review subset of
1767
+ * `LocalMaic`. Use when the canonical MAIC instance is hosted off-process
1768
+ * (e.g. `teleologyhi.com` or a self-hosted MAIC behind your own gateway)
1769
+ * and the NHE runs serverless / edge / in a browser-adjacent environment.
1770
+ *
1771
+ * Wire contract (HTTP):
1772
+ *
1773
+ * POST {baseUrl}/v1/behavior-review
1774
+ * body: BehaviorReport (JSON)
1775
+ * 200: MaicVerdict (JSON)
1776
+ *
1777
+ * GET {baseUrl}/v1/nhes/{nheId}/status
1778
+ * 200: { status: NheStatus }
1779
+ *
1780
+ * GET {baseUrl}/v1/nhes/{nheId}/inductions/pending
1781
+ * 200: { tickets: DreamInductionTicket[] }
1782
+ *
1783
+ * POST {baseUrl}/v1/inductions/{ticketId}/consume
1784
+ * 200: DreamInductionTicket
1785
+ *
1786
+ * Auth: `Authorization: Bearer <apiKey>` when `apiKey` is set.
1787
+ *
1788
+ * Note: writes (axiom mint, HIM register, ratify proposal, etc.) are
1789
+ * deliberately NOT in this surface — they require the Creator's
1790
+ * Ed25519 private key, which never travels over the network. Writes
1791
+ * stay on `LocalMaic` and are performed by the Creator's tooling.
1792
+ */
1793
+ declare class RemoteMaic implements MaicClient {
1794
+ readonly baseUrl: string;
1795
+ private readonly apiKey?;
1796
+ private readonly fetchFn;
1797
+ private readonly timeoutMs;
1798
+ constructor(config: RemoteMaicConfig);
1799
+ /**
1800
+ * `reviewBehavior` is **fail-closed** (E4 — PROPOSED_DECISIONS.md). If the
1801
+ * remote service is unreachable, throw — no governance, no response.
1802
+ * The NHE will surface this as a refusal upstream.
1803
+ */
1804
+ reviewBehavior(report: BehaviorReport): Promise<MaicVerdict>;
1805
+ /**
1806
+ * `getNheStatus` defaults to **"active"** when unreachable (E4). The
1807
+ * Kardecist invariant: an unreachable governance doesn't kill the
1808
+ * spirit. Operators who want fail-closed on lifecycle should wrap with
1809
+ * a watchdog that hard-fails the deployment when the remote drops.
1810
+ */
1811
+ getNheStatus(nheId: string): Promise<NheStatus>;
1812
+ /**
1813
+ * `listPendingInductions` is **fail-open** (E4). No inductions = NHE
1814
+ * skips them and continues the sleep cycle; this is best-effort by
1815
+ * design.
1816
+ */
1817
+ listPendingInductions(nheId: string): Promise<DreamInductionTicket[]>;
1818
+ /**
1819
+ * `consumeInduction` is **fail-open** (E4). If the consume call fails, we
1820
+ * return a synthetic *pending* placeholder so the caller treats the
1821
+ * induction as still-unconsumed and re-tries on the next sleep cycle.
1822
+ *
1823
+ * The placeholder uses placeholder values (`nheId: "unknown"`, epoch
1824
+ * `createdAt`) so it is visibly synthetic in logs/audits, but the shape
1825
+ * is **strictly valid**: `status === "pending"` carries no
1826
+ * `cancelReason`/`cancelledAt`/`consumedAt`, which avoids the
1827
+ * shape-contradiction of a "pending ticket with a cancel reason".
1828
+ * Operators who need the transport-failure reason should observe the
1829
+ * underlying fetch error (e.g. via OpenTelemetry traces) rather than
1830
+ * trying to read it off the ticket.
1831
+ */
1832
+ consumeInduction(ticketId: string): Promise<DreamInductionTicket>;
1833
+ private request;
1834
+ }
1835
+
1836
+ export { ALL_AUDIT_EVENT_KINDS, Affect, ArchetypeModifier, AstrologicalAspect, type AppendInput as AuditAppendInput, type AuditEvent, type AuditEventKind, AuditLog, type QueryFilter as AuditQueryFilter, Axiom, type AxiomEvolutionResult, type AxiomFilter, AxiomProposalRecord, AxiomRank, type AxiomRule, AxiomSource, AxiomStore, BehaviorReport, BirthSignature, type BirthSignatureWithIdentity, type ComplianceEvent, type ComplianceEvidence, type ComplianceFramework, ComplianceMapper, type ProjectOptions as ComplianceProjectOptions, type ComplianceReport, CreatorKeyring, CreatorSignature, DEFAULT_RETENTION_DAYS, DEFAULT_RULE_PACK, DreamInductionIntent, DreamInductionTicket, EU_AI_ACT_MAPPING, EmergentAxiomCandidate, EmergentAxiomProposal, type EuAiActArticle, type HimRecord, HimStore, ISO_42001_MAPPING, IdentityLayer, IdentitySnapshot, InductionStatus, InductionStore, InteractionRecord, InvalidBirthSignatureError, type Iso42001ControlId, LimboReturn, LimboState, LimboTransition, LocalMaic, type LocalMaicConfig, META_AXIOM_ID, type MaicClient, MaicVerdict, MemoryRecord, type MintAxiomRequest, NatalChart, NatalChartAspect, NatalChartPosition, NatalPlanet, NheBodyRef, type NheLifecycleRequest, NheStatus, type NheStatusFilter, NheStatusRecord, NheStatusStore, type OntologicalKernel, type ProjectKernelOptions, type ProposalDecisionRequest, type ProposalListFilter, ProposalStatus, ProposalStore, ReasoningStep, type ReincarnationLifecycle, type ReincarnationRequest, RemoteMaic, type RemoteMaicConfig, type RetentionDecision, type RetentionReport, type RetentionReportOptions, type RetentionStatus, ReviewPipeline, type RuleMatch, type RulePack, SEED_AXIOMS, SEED_NONCE_BASE, SIGNED_BIRTH_FIELDS, type SeedResult, SemioticPattern, SemioticSign, type SignedBirthField, type SignedBirthSignature, TeleologicalOrientation, VerdictKind, WakeAffectBias, ZodiacSign, assertBirthSignature, canonicalJSON, evaluateRetention, projectOntologicalKernel, signBirthSignature, signedBirthPayload, verifyBirthSignature };