@terminals-tech/sdk 1.0.0 → 2.0.0-rc.1

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 (34) hide show
  1. package/README.md +58 -12
  2. package/dist/{WebContainerManager-4LIOGRVM.js → WebContainerManager-NUGGUIWB.js} +2 -2
  3. package/dist/catalog-XA5VYWXG.js +16 -0
  4. package/dist/{chunk-PWAHFID5.js → chunk-D4MOOUDY.js} +3 -3
  5. package/dist/{chunk-FOXUEYWK.js → chunk-GOQHOLBG.js} +4 -3
  6. package/dist/{chunk-STMI72WH.js → chunk-ICFYWOI5.js} +35 -38
  7. package/dist/chunk-PKINKOW2.js +335 -0
  8. package/dist/chunk-PWEICJ47.js +30 -0
  9. package/dist/{chunk-KASHT6C5.js → chunk-Q4W3IUTD.js} +8 -8
  10. package/dist/{chunk-BCOQMFKT.js → chunk-TO7ETE5K.js} +2 -2
  11. package/dist/{chunk-Q2VI6ICE.js → chunk-UB5OINTA.js} +1 -1
  12. package/dist/{chunk-PPFTKJDB.js → chunk-WJCIX7RO.js} +3 -3
  13. package/dist/{chunk-OCLSAUCD.js → chunk-WT6L6DK3.js} +30 -2
  14. package/dist/{chunk-L45BSQDJ.js → chunk-Y5WLSLLW.js} +1 -1
  15. package/dist/{container-lite-QD3CRLS4.js → container-lite-Q3O3EP6R.js} +9 -9
  16. package/dist/core.machine.orchestrator-NW73YDTL.js +24 -0
  17. package/dist/{demo-T655Z5S4.js → demo-WARANXBT.js} +11 -11
  18. package/dist/{hvm-CBEP3M4F.js → hvm-A7DGZ3Q5.js} +1 -1
  19. package/dist/index.cjs +61426 -43456
  20. package/dist/index.d.cts +331 -140
  21. package/dist/index.d.ts +331 -140
  22. package/dist/index.js +253 -328
  23. package/dist/{neuro-state-XHRGIRVO.js → neuro-state-KINIFV2D.js} +6 -6
  24. package/dist/{nodes-K6GKI2FM.js → nodes-TWQZUZRM.js} +10 -10
  25. package/dist/{registry-5WTDYQVQ.js → registry-UARRB6CF.js} +9 -9
  26. package/dist/{scheduler-B5CEYKWT.js → scheduler-SAQJLKXJ.js} +16 -14
  27. package/dist/sematon-2EUEZESN.js +19 -0
  28. package/dist/{server-VW6DYDLH.js → server-JXM4Y2T6.js} +1 -1
  29. package/dist/{skills-VN7IN7SJ.js → skills-XOFGMUP4.js} +2 -2
  30. package/dist/{stack-4KWCQQP7.js → stack-4QQCK7MG.js} +17 -15
  31. package/dist/{supabaseService-6AYP2VY3.js → supabaseService-O4ZFFLZP.js} +2 -2
  32. package/dist/{webcontainer-XWCE56F3.js → webcontainer-PMWNRO4I.js} +2 -2
  33. package/package.json +3 -3
  34. package/dist/{chunk-LLGZTP3G.js → chunk-P4D4RNAV.js} +4 -4
package/dist/index.d.ts CHANGED
@@ -620,7 +620,11 @@ declare function calculateCoherenceWithExplanations(input: CoherenceInput, confi
620
620
  /**
621
621
  * Validation Primitives (IO Boundary Security)
622
622
  *
623
- * Uses Ajv for JSON Schema validation.
623
+ * JSON Schema validation engine using Ajv. This is one of several validation
624
+ * engines behind the stable proof contract ({@link Validated}, {@link Untrusted},
625
+ * {@link unbrand}). The proof contract is engine-agnostic — TS-first boundaries
626
+ * may use Zod; data-first boundaries use this Ajv path; native boundaries use
627
+ * Rust serde. The branded types are the stable public API, not the engine.
624
628
  *
625
629
  * IMPORTANT: This module is NOT compatible with Vercel Edge Runtime (Middleware)
626
630
  * because Ajv uses `new Function()` for schema compilation. For Edge-compatible
@@ -1029,7 +1033,7 @@ declare function kuramotoStep(phases: ArrayLike<number>, omega: ArrayLike<number
1029
1033
  /**
1030
1034
  * Signal types for cross-layer communication
1031
1035
  */
1032
- type SignalType = "health_update" | "circuit_change" | "convergence_update" | "coherence_update" | "resonance_update" | "tensor_state_update" | "task_complete" | "task_failed" | "adaptation_required" | "backpressure_warning" | "audio_metrics_update" | "mesh_update" | "mesh_query" | "session_state_change" | "skill_capture_started" | "skill_action_recorded" | "skill_capture_completed" | "skill_crystallized" | "skill_training_started" | "skill_training_completed" | "skill_artifact_activated" | "skill_suggested" | "skill_executed" | "skill_peer_review" | "skill_delegation" | "skill_agent_refine" | "skill_selection" | "skill_backpressure" | "skill_budget_exceeded" | "skill_error" | "interaction_created" | "interaction_status_changed" | "deploy_scaffold" | "deploy_push" | "deploy_build" | "deploy_status" | "deploy_preview" | "deploy_live" | "deploy_error" | "potentiation_rising" | "potentiation_peak" | "potentiation_discharge" | "potentiation_reset" | "action_dispatched" | "action_executed" | "action_failed" | "combo_completed" | "input_surface_changed" | "forge_scene_saved" | "forge_iteration_recorded" | "forge_profile_crystallized" | "forge_profile_requested" | "integration_connected" | "integration_disconnected" | "integration_heartbeat" | "integration_error" | "ui_navigation" | "ui_surface_opened" | "ui_surface_closed" | "ui_interaction" | "ui_error_shown" | "ui_search" | "artifact_preview" | "manifold_node_added" | "manifold_edge_added" | "manifold_query" | "manifold_snapshot" | "connector_status_changed" | "connector_sync_started" | "connector_sync_complete" | "connector_sync_error" | "connector_document_indexed" | "graph_entity_upserted" | "graph_relationship_added" | "graph_traversal_complete" | "intent_signal_emitted" | "oscillator_phase_updated" | "oscillator_suggestion_generated" | "journey_note_created" | "journey_note_deleted" | "journey_edge_created" | "journey_cluster_created" | "journey_replay_entered" | "journey_replay_exited" | "journey_spatial_navigate" | "journey_completed" | "boundary_crossed" | "boundary_sealed" | "convergence_declared" | "convergence_lost" | "crystallization_declared" | "crystallization_melted" | "chat_message_sent" | "chat_message_received" | "chat_error" | "coherence_gate_accepted" | "coherence_gate_rejected" | "manifold_geodesic_computed" | "manifold_distance_measured" | "sematon_created" | "sematon_witnessed" | "sematon_folded" | "sematon_realized" | "sematon_expired" | "voice_identity_encoded" | "voice_speaking_started" | "voice_speaking_completed" | "voice_chunk_scheduled" | "voice_coherence_mapped";
1036
+ type SignalType = "health_update" | "circuit_change" | "convergence_update" | "coherence_update" | "resonance_update" | "tensor_state_update" | "task_complete" | "task_failed" | "adaptation_required" | "backpressure_warning" | "audio_metrics_update" | "mesh_update" | "mesh_metrics_update" | "mesh_query" | "session_state_change" | "skill_capture_started" | "skill_action_recorded" | "skill_capture_completed" | "skill_crystallized" | "skill_training_started" | "skill_training_completed" | "skill_artifact_activated" | "skill_suggested" | "skill_executed" | "skill_peer_review" | "skill_delegation" | "skill_agent_refine" | "skill_selection" | "skill_backpressure" | "skill_budget_exceeded" | "skill_error" | "interaction_created" | "interaction_status_changed" | "deploy_scaffold" | "deploy_push" | "deploy_build" | "deploy_status" | "deploy_preview" | "deploy_live" | "deploy_error" | "potentiation_rising" | "potentiation_peak" | "potentiation_discharge" | "potentiation_reset" | "action_dispatched" | "action_executed" | "action_failed" | "combo_completed" | "input_surface_changed" | "forge_scene_saved" | "forge_iteration_recorded" | "forge_profile_crystallized" | "forge_profile_requested" | "integration_connected" | "integration_disconnected" | "integration_heartbeat" | "integration_error" | "ui_navigation" | "ui_surface_opened" | "ui_surface_closed" | "ui_interaction" | "ui_error_shown" | "ui_search" | "artifact_preview" | "manifold_node_added" | "manifold_edge_added" | "manifold_query" | "manifold_snapshot" | "connector_status_changed" | "connector_sync_started" | "connector_sync_complete" | "connector_sync_error" | "connector_document_indexed" | "graph_entity_upserted" | "graph_relationship_added" | "graph_traversal_complete" | "intent_signal_emitted" | "oscillator_phase_updated" | "oscillator_suggestion_generated" | "journey_note_created" | "journey_note_deleted" | "journey_edge_created" | "journey_cluster_created" | "journey_replay_entered" | "journey_replay_exited" | "journey_spatial_navigate" | "journey_completed" | "boundary_crossed" | "boundary_sealed" | "convergence_declared" | "convergence_lost" | "crystallization_declared" | "crystallization_melted" | "chat_message_sent" | "chat_message_received" | "chat_error" | "coherence_gate_accepted" | "coherence_gate_rejected" | "manifold_geodesic_computed" | "manifold_distance_measured" | "sematon_created" | "sematon_witnessed" | "sematon_folded" | "sematon_realized" | "sematon_expired" | "voice_identity_encoded" | "voice_speaking_started" | "voice_speaking_completed" | "voice_chunk_scheduled" | "voice_coherence_mapped";
1033
1037
  /**
1034
1038
  * Layer-aware signal for AXON cross-layer communication
1035
1039
  */
@@ -1344,6 +1348,326 @@ interface PlatformConfig {
1344
1348
  audio?: AudioSourceConfig;
1345
1349
  }
1346
1350
 
1351
+ /**
1352
+ * L0 Sematon — The Smallest Meaning-Bearing Unit
1353
+ *
1354
+ * The sematon is the atomic unit of operational meaning in Terminals OS.
1355
+ * It carries a typed payload, convergence witness, p-adic address,
1356
+ * information-theoretic metrics, and a constructor flag that guarantees
1357
+ * the Deutsch-Marletto invariant: after transforming an input, the
1358
+ * sematon retains the ability to transform again.
1359
+ *
1360
+ * The sematon unifies Signal<T>, ContextNode, FractalSnapshot,
1361
+ * ConvergenceWitness, and CombinatorEvent into a single formal type
1362
+ * at the L0 foundation layer.
1363
+ *
1364
+ * Core Engine Primitive.
1365
+ *
1366
+ * @license BUSL-1.1
1367
+ * @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
1368
+ * @module core/L0/sematon
1369
+ */
1370
+ /**
1371
+ * Payload kind classification for sematons.
1372
+ * Determines how the payload is interpreted across layers.
1373
+ */
1374
+ type SematonKind = "signal" | "context" | "fractal" | "witness" | "combinator" | "interaction" | "custom";
1375
+ /**
1376
+ * Convergence witness snapshot embedded in a sematon.
1377
+ * Minimal subset of ConvergenceWitness for portability.
1378
+ */
1379
+ interface SematonWitness {
1380
+ /** Kuramoto order parameter R in [0, 1] */
1381
+ R: number;
1382
+ /** Shannon entropy of activation distribution */
1383
+ activationEntropy: number;
1384
+ /** Whether convergence criteria are met */
1385
+ converged: boolean;
1386
+ /** Step at which this witness was taken */
1387
+ step: number;
1388
+ }
1389
+ /**
1390
+ * The Sematon — smallest meaning-bearing unit with operational consequence.
1391
+ *
1392
+ * Generic over T (the payload type):
1393
+ * T = Signal payload at signal kind
1394
+ * T = ContextNode metadata at context kind
1395
+ * T = FractalSnapshot at fractal kind
1396
+ * T = arbitrary at custom kind
1397
+ */
1398
+ interface Sematon<T = unknown> {
1399
+ /** Unique identifier */
1400
+ readonly id: string;
1401
+ /** Payload kind classification */
1402
+ readonly kind: SematonKind;
1403
+ /** The meaning-bearing payload */
1404
+ readonly payload: T;
1405
+ /** Convergence witness at creation time */
1406
+ readonly witness: SematonWitness;
1407
+ /** p-adic address for hierarchical locality */
1408
+ readonly padicAddress: string;
1409
+ /** Shannon entropy of payload (bits) */
1410
+ readonly entropy: number;
1411
+ /** Semantic density (bits per token) */
1412
+ readonly density: number;
1413
+ /** The resistance to constructive transformation: H / (ρ * R) */
1414
+ readonly impedance: number;
1415
+ /** Deterministic content hash (FNV-1a) */
1416
+ readonly shapeHash: string;
1417
+ /**
1418
+ * Constructor flag: can this sematon participate in further transformations?
1419
+ * True iff: witness has converged AND entropy is finite AND payload is non-empty.
1420
+ * This is the Deutsch-Marletto invariant.
1421
+ */
1422
+ readonly constructive: boolean;
1423
+ /** Creation timestamp */
1424
+ readonly createdAt: number;
1425
+ /** Source layer or surface that produced this sematon */
1426
+ readonly source: string;
1427
+ }
1428
+ /**
1429
+ * Folded (serializable) representation of a Sematon.
1430
+ * Suitable for JSON serialization, mesh relay, or persistence.
1431
+ */
1432
+ interface FoldedSematon {
1433
+ id: string;
1434
+ kind: SematonKind;
1435
+ payload: string;
1436
+ witness: SematonWitness;
1437
+ padicAddress: string;
1438
+ entropy: number;
1439
+ density: number;
1440
+ impedance: number;
1441
+ shapeHash: string;
1442
+ constructive: boolean;
1443
+ createdAt: number;
1444
+ source: string;
1445
+ }
1446
+ interface SematonConfig<T> {
1447
+ kind: SematonKind;
1448
+ payload: T;
1449
+ witness: SematonWitness;
1450
+ padicAddress?: string;
1451
+ source?: string;
1452
+ }
1453
+ /**
1454
+ * Create a new Sematon from configuration.
1455
+ */
1456
+ declare function createSematon<T>(config: SematonConfig<T>): Sematon<T>;
1457
+ /**
1458
+ * Get the Shannon entropy of a sematon's payload.
1459
+ */
1460
+ declare function sematonEntropy<T>(sematon: Sematon<T>): number;
1461
+ /**
1462
+ * Get the semantic density of a sematon.
1463
+ */
1464
+ declare function sematonDensity<T>(sematon: Sematon<T>): number;
1465
+ /**
1466
+ * Check if a sematon can participate in further transformations.
1467
+ * This is the Deutsch-Marletto constructor invariant.
1468
+ */
1469
+ declare function isRealizable<T>(sematon: Sematon<T>): boolean;
1470
+ /**
1471
+ * Compute distance between two sematons using payload cosine similarity
1472
+ * weighted by witness R proximity.
1473
+ *
1474
+ * Distance in [0, 1] where 0 = identical, 1 = maximally different.
1475
+ */
1476
+ declare function sematonDistance<T>(a: Sematon<T>, b: Sematon<T>): number;
1477
+ /**
1478
+ * Fold a Sematon into a JSON-serializable representation.
1479
+ * HVM γ (construct) — compress for handoff, persistence, or relay.
1480
+ */
1481
+ declare function foldSematon<T>(sematon: Sematon<T>): FoldedSematon;
1482
+ /**
1483
+ * Unfold a serialized representation back into a Sematon.
1484
+ * HVM δ (duplicate) — expand from handoff, persistence, or relay.
1485
+ */
1486
+ declare function unfoldSematon<T>(folded: FoldedSematon): Sematon<T>;
1487
+
1488
+ /**
1489
+ * ELI5 Result Types for @terminals-tech/agent
1490
+ *
1491
+ * Wraps internal Sematon<TerminalRunResult> into developer-friendly types.
1492
+ * Theory stays in the engine; developers get plain objects.
1493
+ *
1494
+ * @license MIT
1495
+ * @module agent/result
1496
+ */
1497
+
1498
+ /**
1499
+ * Execution receipt — cryptographic proof that the workflow executed.
1500
+ * This is a Sematon under the hood, but developers see "receipt".
1501
+ */
1502
+ type ExecutionReceipt = Sematon<TerminalRunResult>;
1503
+ /**
1504
+ * A single execution step in the workflow trace.
1505
+ */
1506
+ interface Step {
1507
+ /** Which agent ran this step */
1508
+ agent: string;
1509
+ /** Step output data */
1510
+ output: unknown;
1511
+ /** Step index in the execution sequence */
1512
+ index: number;
1513
+ }
1514
+ /**
1515
+ * Per-agent performance report.
1516
+ */
1517
+ interface AgentReport {
1518
+ /** Agent node ID */
1519
+ id: string;
1520
+ /** Agent output data */
1521
+ output: unknown;
1522
+ }
1523
+ /**
1524
+ * The developer-facing result from Terminal.run().
1525
+ *
1526
+ * Provides direct access to outputs, coherence score, and execution proof
1527
+ * without requiring knowledge of Sematons or Kuramoto dynamics.
1528
+ */
1529
+ interface TerminalResult {
1530
+ /** The text output from the final agent in the workflow */
1531
+ text: string;
1532
+ /** Coherence score: 0-1 measure of agent alignment quality */
1533
+ coherence: number;
1534
+ /** Execution receipt — proof the workflow ran correctly */
1535
+ receipt: ExecutionReceipt;
1536
+ /** Ordered execution steps */
1537
+ steps: Step[];
1538
+ /** Per-agent performance reports */
1539
+ agents: AgentReport[];
1540
+ /** Total execution time in milliseconds */
1541
+ duration: number;
1542
+ }
1543
+
1544
+ /**
1545
+ * Terminal.create() Developer API
1546
+ *
1547
+ * The developer-facing entry point for creating and running multi-agent
1548
+ * terminal workflows. Translates semantic configuration into the internal
1549
+ * StackManifestV0 / OrchestratorV0 infrastructure and wraps results as
1550
+ * Sematon<TerminalRunResult>.
1551
+ *
1552
+ * This is a headless API -- no React, no "use client".
1553
+ *
1554
+ * @license BUSL-1.1
1555
+ * @copyright 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
1556
+ * @module agent-sdk/terminal
1557
+ */
1558
+
1559
+ /**
1560
+ * Agent definition within a terminal workflow.
1561
+ */
1562
+ interface TerminalAgent {
1563
+ /** Role name for the agent (e.g. "researcher", "writer", "reviewer") */
1564
+ role: string;
1565
+ /** Optional capability declarations for this agent */
1566
+ capabilities?: string[];
1567
+ }
1568
+ /**
1569
+ * Coherence configuration for convergence-aware execution.
1570
+ */
1571
+ interface TerminalCoherenceConfig {
1572
+ /** Kuramoto R threshold for constructive sematon flag (default: 0.6) */
1573
+ threshold?: number;
1574
+ /** Ground truth strings for coherence grounding */
1575
+ groundTruth?: string[];
1576
+ }
1577
+ /**
1578
+ * Developer-facing configuration for Terminal.create().
1579
+ *
1580
+ * Named TerminalCreateConfig to avoid collision with the internal
1581
+ * TerminalConfig from core/terminal.ts.
1582
+ */
1583
+ interface TerminalCreateConfig {
1584
+ /** Agent definitions -- each becomes a provider.chat.v1 node */
1585
+ agents: TerminalAgent[];
1586
+ /** The task prompt driving the workflow */
1587
+ task: string;
1588
+ /** Coherence / convergence settings */
1589
+ coherence?: TerminalCoherenceConfig;
1590
+ /** LLM provider identifier (e.g. "openrouter", "anthropic") */
1591
+ provider?: string;
1592
+ /** Model identifier (e.g. "claude-sonnet-4-20250514") */
1593
+ model?: string;
1594
+ }
1595
+ /**
1596
+ * Developer-facing configuration — the simplified public interface.
1597
+ * Extends TerminalCreateConfig with orchestration and verification options.
1598
+ */
1599
+ interface TerminalConfig extends TerminalCreateConfig {
1600
+ /** Orchestration strategy for multi-agent execution */
1601
+ orchestration?: "sequential" | "parallel" | "society" | "consensus";
1602
+ /** Enable DRM execution verification (generates execution receipts) */
1603
+ verify?: boolean;
1604
+ /** Enable streaming mode */
1605
+ stream?: boolean;
1606
+ }
1607
+ /**
1608
+ * Result payload wrapped inside a Sematon after Terminal.run().
1609
+ */
1610
+ interface TerminalRunResult {
1611
+ /** Collected outputs from all agent nodes, keyed by node ID */
1612
+ outputs: Record<string, unknown>;
1613
+ /** Total execution duration in milliseconds */
1614
+ duration: number;
1615
+ }
1616
+ /**
1617
+ * Terminal -- the developer-facing orchestration API.
1618
+ *
1619
+ * Usage:
1620
+ * ```ts
1621
+ * const t = await Terminal.create({
1622
+ * agents: [
1623
+ * { role: "researcher" },
1624
+ * { role: "writer", capabilities: ["markdown"] },
1625
+ * ],
1626
+ * task: "Write a technical summary of quantum error correction",
1627
+ * coherence: { threshold: 0.7 },
1628
+ * provider: "openrouter",
1629
+ * model: "anthropic/claude-sonnet-4-20250514",
1630
+ * });
1631
+ *
1632
+ * const result = await t.run();
1633
+ * console.log(result.payload.outputs);
1634
+ * ```
1635
+ */
1636
+ declare class Terminal {
1637
+ /** Unique terminal identifier */
1638
+ readonly id: string;
1639
+ private readonly config;
1640
+ private readonly manifest;
1641
+ private constructor();
1642
+ /**
1643
+ * Create a new Terminal from semantic configuration.
1644
+ *
1645
+ * Translates the developer-friendly config into internal stack manifests,
1646
+ * registers required nodes, and returns a ready-to-run Terminal.
1647
+ */
1648
+ static create(config: TerminalCreateConfig): Promise<Terminal>;
1649
+ /**
1650
+ * Execute the terminal workflow and return a Sematon-wrapped result.
1651
+ *
1652
+ * Uses OrchestratorV0 to run the DAG, then wraps the output
1653
+ * in a Sematon<TerminalRunResult> with convergence witness.
1654
+ */
1655
+ run(): Promise<Sematon<TerminalRunResult>>;
1656
+ /**
1657
+ * Static convenience: create and run a terminal in one call.
1658
+ * Returns a developer-friendly TerminalResult instead of a raw Sematon.
1659
+ */
1660
+ static run(config: TerminalConfig): Promise<TerminalResult>;
1661
+ /**
1662
+ * Chain a new terminal execution from a previous Sematon result.
1663
+ *
1664
+ * Extracts `prev.payload.outputs` and injects them as `previousOutputs`
1665
+ * in the config overrides, then creates a new Terminal, runs it, and
1666
+ * returns the new Sematon.
1667
+ */
1668
+ static chain(prev: Sematon<unknown>, config: Partial<TerminalCreateConfig>): Promise<Sematon<TerminalRunResult>>;
1669
+ }
1670
+
1347
1671
  /**
1348
1672
  * Terminal SDK — High-level Terminal management
1349
1673
  *
@@ -1363,9 +1687,13 @@ type terminal_PlatformIdentity = PlatformIdentity;
1363
1687
  type terminal_PlatformTheme = PlatformTheme;
1364
1688
  type terminal_SurfaceId = SurfaceId;
1365
1689
  type terminal_TaskStatus = TaskStatus;
1690
+ type terminal_Terminal = Terminal;
1691
+ declare const terminal_Terminal: typeof Terminal;
1692
+ type terminal_TerminalCreateConfig = TerminalCreateConfig;
1693
+ type terminal_TerminalRunResult = TerminalRunResult;
1366
1694
  declare const terminal_createInteractionWithEvents: typeof createInteractionWithEvents;
1367
1695
  declare namespace terminal {
1368
- export { type terminal_Interaction as Interaction, type terminal_InteractionStatus as InteractionStatus, type terminal_InteractionType as InteractionType, type terminal_LayerLevel as LayerLevel, type terminal_PlatformConfig as PlatformConfig, type terminal_PlatformIdentity as PlatformIdentity, type terminal_PlatformTheme as PlatformTheme, type terminal_SurfaceId as SurfaceId, type terminal_TaskStatus as TaskStatus, createInteractionWithEvents as createInteraction, terminal_createInteractionWithEvents as createInteractionWithEvents };
1696
+ export { type terminal_Interaction as Interaction, type terminal_InteractionStatus as InteractionStatus, type terminal_InteractionType as InteractionType, type terminal_LayerLevel as LayerLevel, type terminal_PlatformConfig as PlatformConfig, type terminal_PlatformIdentity as PlatformIdentity, type terminal_PlatformTheme as PlatformTheme, type terminal_SurfaceId as SurfaceId, type terminal_TaskStatus as TaskStatus, terminal_Terminal as Terminal, type terminal_TerminalCreateConfig as TerminalCreateConfig, type terminal_TerminalRunResult as TerminalRunResult, createInteractionWithEvents as createInteraction, terminal_createInteractionWithEvents as createInteractionWithEvents };
1369
1697
  }
1370
1698
 
1371
1699
  /**
@@ -1962,143 +2290,6 @@ declare function checkCompatibility(shapeA: TypeShape, shapeB: TypeShape): numbe
1962
2290
  */
1963
2291
  declare function canEmbed(source: TypeShape, target: TypeShape): boolean;
1964
2292
 
1965
- /**
1966
- * L0 Sematon — The Smallest Meaning-Bearing Unit
1967
- *
1968
- * The sematon is the atomic unit of operational meaning in Terminals OS.
1969
- * It carries a typed payload, convergence witness, p-adic address,
1970
- * information-theoretic metrics, and a constructor flag that guarantees
1971
- * the Deutsch-Marletto invariant: after transforming an input, the
1972
- * sematon retains the ability to transform again.
1973
- *
1974
- * The sematon unifies Signal<T>, ContextNode, FractalSnapshot,
1975
- * ConvergenceWitness, and CombinatorEvent into a single formal type
1976
- * at the L0 foundation layer.
1977
- *
1978
- * Core Engine Primitive.
1979
- *
1980
- * @license BUSL-1.1
1981
- * @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
1982
- * @module core/L0/sematon
1983
- */
1984
- /**
1985
- * Payload kind classification for sematons.
1986
- * Determines how the payload is interpreted across layers.
1987
- */
1988
- type SematonKind = "signal" | "context" | "fractal" | "witness" | "combinator" | "interaction" | "custom";
1989
- /**
1990
- * Convergence witness snapshot embedded in a sematon.
1991
- * Minimal subset of ConvergenceWitness for portability.
1992
- */
1993
- interface SematonWitness {
1994
- /** Kuramoto order parameter R in [0, 1] */
1995
- R: number;
1996
- /** Shannon entropy of activation distribution */
1997
- activationEntropy: number;
1998
- /** Whether convergence criteria are met */
1999
- converged: boolean;
2000
- /** Step at which this witness was taken */
2001
- step: number;
2002
- }
2003
- /**
2004
- * The Sematon — smallest meaning-bearing unit with operational consequence.
2005
- *
2006
- * Generic over T (the payload type):
2007
- * T = Signal payload at signal kind
2008
- * T = ContextNode metadata at context kind
2009
- * T = FractalSnapshot at fractal kind
2010
- * T = arbitrary at custom kind
2011
- */
2012
- interface Sematon<T = unknown> {
2013
- /** Unique identifier */
2014
- readonly id: string;
2015
- /** Payload kind classification */
2016
- readonly kind: SematonKind;
2017
- /** The meaning-bearing payload */
2018
- readonly payload: T;
2019
- /** Convergence witness at creation time */
2020
- readonly witness: SematonWitness;
2021
- /** p-adic address for hierarchical locality */
2022
- readonly padicAddress: string;
2023
- /** Shannon entropy of payload (bits) */
2024
- readonly entropy: number;
2025
- /** Semantic density (bits per token) */
2026
- readonly density: number;
2027
- /** The resistance to constructive transformation: H / (ρ * R) */
2028
- readonly impedance: number;
2029
- /** Deterministic content hash (FNV-1a) */
2030
- readonly shapeHash: string;
2031
- /**
2032
- * Constructor flag: can this sematon participate in further transformations?
2033
- * True iff: witness has converged AND entropy is finite AND payload is non-empty.
2034
- * This is the Deutsch-Marletto invariant.
2035
- */
2036
- readonly constructive: boolean;
2037
- /** Creation timestamp */
2038
- readonly createdAt: number;
2039
- /** Source layer or surface that produced this sematon */
2040
- readonly source: string;
2041
- }
2042
- /**
2043
- * Folded (serializable) representation of a Sematon.
2044
- * Suitable for JSON serialization, mesh relay, or persistence.
2045
- */
2046
- interface FoldedSematon {
2047
- id: string;
2048
- kind: SematonKind;
2049
- payload: string;
2050
- witness: SematonWitness;
2051
- padicAddress: string;
2052
- entropy: number;
2053
- density: number;
2054
- impedance: number;
2055
- shapeHash: string;
2056
- constructive: boolean;
2057
- createdAt: number;
2058
- source: string;
2059
- }
2060
- interface SematonConfig<T> {
2061
- kind: SematonKind;
2062
- payload: T;
2063
- witness: SematonWitness;
2064
- padicAddress?: string;
2065
- source?: string;
2066
- }
2067
- /**
2068
- * Create a new Sematon from configuration.
2069
- */
2070
- declare function createSematon<T>(config: SematonConfig<T>): Sematon<T>;
2071
- /**
2072
- * Get the Shannon entropy of a sematon's payload.
2073
- */
2074
- declare function sematonEntropy<T>(sematon: Sematon<T>): number;
2075
- /**
2076
- * Get the semantic density of a sematon.
2077
- */
2078
- declare function sematonDensity<T>(sematon: Sematon<T>): number;
2079
- /**
2080
- * Check if a sematon can participate in further transformations.
2081
- * This is the Deutsch-Marletto constructor invariant.
2082
- */
2083
- declare function isRealizable<T>(sematon: Sematon<T>): boolean;
2084
- /**
2085
- * Compute distance between two sematons using payload cosine similarity
2086
- * weighted by witness R proximity.
2087
- *
2088
- * Distance in [0, 1] where 0 = identical, 1 = maximally different.
2089
- */
2090
- declare function sematonDistance<T>(a: Sematon<T>, b: Sematon<T>): number;
2091
- /**
2092
- * Fold a Sematon into a JSON-serializable representation.
2093
- * HVM γ (construct) — compress for handoff, persistence, or relay.
2094
- */
2095
- declare function foldSematon<T>(sematon: Sematon<T>): FoldedSematon;
2096
- /**
2097
- * Unfold a serialized representation back into a Sematon.
2098
- * HVM δ (duplicate) — expand from handoff, persistence, or relay.
2099
- */
2100
- declare function unfoldSematon<T>(folded: FoldedSematon): Sematon<T>;
2101
-
2102
2293
  /**
2103
2294
  * L0 Realizability Trace — Constructor Proof Runtime
2104
2295
  *