@terminals-tech/sdk 1.0.0-rc.1 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WebContainerManager-SHXC5VKI.js +22 -0
- package/dist/browser-http-client-ZQLDWZMU.js +317 -0
- package/dist/cache-VKYSQRXX.js +45 -0
- package/dist/capabilities-MIPUMBLL.js +96 -0
- package/dist/chunk-2ESYSVXG.js +48 -0
- package/dist/chunk-2WTYE4SW.js +190 -0
- package/dist/chunk-3CEM77QZ.js +474 -0
- package/dist/chunk-3LFMIVJM.js +40 -0
- package/dist/chunk-ABCK4FWN.js +136 -0
- package/dist/chunk-AFDUOYHD.js +2060 -0
- package/dist/chunk-BCOQMFKT.js +265 -0
- package/dist/chunk-BKB3MD5Y.js +723 -0
- package/dist/chunk-BYXBJQAS.js +0 -0
- package/dist/chunk-DKFJIILR.js +9798 -0
- package/dist/chunk-EXI3LJVJ.js +51 -0
- package/dist/chunk-FOXUEYWK.js +42 -0
- package/dist/chunk-GJWAJAX3.js +173 -0
- package/dist/chunk-H3POJCFA.js +333 -0
- package/dist/chunk-KHR7ZYCX.js +4034 -0
- package/dist/chunk-NTMBOESX.js +152 -0
- package/dist/chunk-OSSRZOGC.js +190 -0
- package/dist/chunk-PUZ2S62E.js +977 -0
- package/dist/chunk-PWAHFID5.js +381 -0
- package/dist/chunk-Q2VI6ICE.js +188 -0
- package/dist/chunk-Q4B7YS7T.js +557 -0
- package/dist/chunk-QJFKEQHF.js +6460 -0
- package/dist/chunk-QWXPVB2L.js +320 -0
- package/dist/chunk-QWZRZKLZ.js +896 -0
- package/dist/chunk-SHPGIVDH.js +5521 -0
- package/dist/chunk-TSQ3BGLA.js +11945 -0
- package/dist/chunk-UJDUQNE2.js +79 -0
- package/dist/chunk-UKVUPKZP.js +296 -0
- package/dist/chunk-VZA2NUH3.js +118 -0
- package/dist/chunk-WGBCRNMB.js +1817 -0
- package/dist/chunk-WU4OTGJE.js +752 -0
- package/dist/chunk-XPJ63Y6T.js +70 -0
- package/dist/chunk-Y2EULKA2.js +172 -0
- package/dist/chunk-YJEZWCYV.js +94 -0
- package/dist/chunk-ZVO47SQV.js +150 -0
- package/dist/container-lite-KQX3NMPY.js +327 -0
- package/dist/core-H2UUDATO.js +146 -0
- package/dist/crypto-D4LMI2RN.js +45 -0
- package/dist/db-BWC2GGBN.js +50 -0
- package/dist/demo-VXMGMJNK.js +87 -0
- package/dist/diagnostics-6RQTBR6I.js +113 -0
- package/dist/dist-OPDCWARF.js +727 -0
- package/dist/dist-VXJEKX3T.js +2441 -0
- package/dist/dist-VYGJXGUS.js +1008 -0
- package/dist/embeddings-7QXTXUMC.js +15 -0
- package/dist/embeddings-MAEWWUHW.js +9 -0
- package/dist/graph-RKMNE2X5.js +36 -0
- package/dist/hvm-DRQK2MUT.js +126 -0
- package/dist/index.cjs +11706 -4004
- package/dist/index.d.cts +1299 -1339
- package/dist/index.d.ts +1299 -1339
- package/dist/index.js +189 -7938
- package/dist/mcp-NK34ZNM5.js +101 -0
- package/dist/mcp-client-service-browser-SGB2K3VZ.js +14 -0
- package/dist/neuro-state-XHRGIRVO.js +498 -0
- package/dist/nodes-DXKYDTVO.js +224 -0
- package/dist/package-EXUIU2RL.js +93 -0
- package/dist/package-VGL7HYTO.js +106 -0
- package/dist/package-XHMLOAQ4.js +98 -0
- package/dist/pg-events-QJAM2HIP.js +15 -0
- package/dist/pgliteService-IUGNNOVU.js +258 -0
- package/dist/policy-IRJCM6FS.js +13 -0
- package/dist/registry-BL3TDQDB.js +26 -0
- package/dist/registry-FW63E7FE.js +16 -0
- package/dist/registry-ZQ2IBLF6.js +9 -0
- package/dist/scheduler-H6Q53IMI.js +122 -0
- package/dist/secret-store-H7273UIT.js +18 -0
- package/dist/server-7DM74VFW.js +18 -0
- package/dist/skills-KLTTT2RM.js +6375 -0
- package/dist/stack-CHDAFU2S.js +103 -0
- package/dist/storage-L7MWNSPG.js +13 -0
- package/dist/supabaseService-6AYP2VY3.js +476 -0
- package/dist/topology-CIWWNVAN.js +13 -0
- package/dist/webcontainer-3LDJVIIL.js +281 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -549,6 +549,16 @@ interface CoherenceMetrics$1 {
|
|
|
549
549
|
timestamp: number;
|
|
550
550
|
}
|
|
551
551
|
|
|
552
|
+
/**
|
|
553
|
+
* Brain Coherence Module
|
|
554
|
+
* Metrics for measuring cognitive coherence in agent outputs
|
|
555
|
+
*
|
|
556
|
+
* Based on NEURO coherence patterns:
|
|
557
|
+
* - Grounding: Connection to factual/contextual reality
|
|
558
|
+
* - Internal: Self-consistency of reasoning
|
|
559
|
+
* - Crystallization: Clarity and actionability of output
|
|
560
|
+
*/
|
|
561
|
+
|
|
552
562
|
type CoherenceMetrics = CoherenceMetrics$1;
|
|
553
563
|
/**
|
|
554
564
|
* Enhanced coherence result with human-readable explanations
|
|
@@ -1015,7 +1025,7 @@ declare function kuramotoStep(phases: ArrayLike<number>, omega: ArrayLike<number
|
|
|
1015
1025
|
/**
|
|
1016
1026
|
* Signal types for cross-layer communication
|
|
1017
1027
|
*/
|
|
1018
|
-
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";
|
|
1028
|
+
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";
|
|
1019
1029
|
/**
|
|
1020
1030
|
* Layer-aware signal for AXON cross-layer communication
|
|
1021
1031
|
*/
|
|
@@ -1473,677 +1483,159 @@ declare function createCircuitBreaker(options: CircuitBreakerOptions): {
|
|
|
1473
1483
|
reset(): void;
|
|
1474
1484
|
};
|
|
1475
1485
|
|
|
1476
|
-
type NodePolicy = NodePolicy$1;
|
|
1477
|
-
type StackPolicies = StackPolicies$1;
|
|
1478
1486
|
/**
|
|
1479
|
-
*
|
|
1487
|
+
* Core SDK — Fundamental utilities and data structures
|
|
1480
1488
|
*
|
|
1481
|
-
*
|
|
1482
|
-
*
|
|
1483
|
-
* - `container-lite`: Lightweight containerized runtime
|
|
1484
|
-
* - `webcontainer`: Browser-based container (WebAssembly)
|
|
1485
|
-
* - `edge`: Edge function/serverless
|
|
1486
|
-
* - `wasm-hvm`: WebAssembly with HVM (Higher-order Virtual Machine)
|
|
1487
|
-
* - `stack`: Nested stack execution
|
|
1489
|
+
* Result types, retry/circuit-breaker, event bus, validation, DAG, registry.
|
|
1490
|
+
* Hides internal combinators, vector ops, stream internals.
|
|
1488
1491
|
*
|
|
1489
|
-
* @
|
|
1490
|
-
*
|
|
1492
|
+
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
1493
|
+
* @module sdk/core
|
|
1491
1494
|
*/
|
|
1492
|
-
|
|
1495
|
+
|
|
1496
|
+
type core_CircuitBreakerOptions = CircuitBreakerOptions;
|
|
1497
|
+
type core_DAG<N, E = void> = DAG<N, E>;
|
|
1498
|
+
type core_DAGEdge<E = void> = DAGEdge<E>;
|
|
1499
|
+
type core_DAGNode<T> = DAGNode<T>;
|
|
1500
|
+
type core_EventHandler<T> = EventHandler<T>;
|
|
1501
|
+
type core_Registry<K, V> = Registry<K, V>;
|
|
1502
|
+
type core_RetryOptions = RetryOptions;
|
|
1503
|
+
type core_SDKResult<T, E = Error> = SDKResult<T, E>;
|
|
1504
|
+
type core_StoreError = StoreError;
|
|
1505
|
+
type core_TypedEventBus<Events extends Record<string, unknown>> = TypedEventBus<Events>;
|
|
1506
|
+
type core_Untrusted<T> = Untrusted<T>;
|
|
1507
|
+
type core_Validated<T> = Validated<T>;
|
|
1508
|
+
declare const core_createCircuitBreaker: typeof createCircuitBreaker;
|
|
1509
|
+
declare const core_createDAG: typeof createDAG;
|
|
1510
|
+
declare const core_createEventBus: typeof createEventBus;
|
|
1511
|
+
declare const core_createRegistry: typeof createRegistry;
|
|
1512
|
+
declare const core_err: typeof err;
|
|
1513
|
+
declare const core_isErr: typeof isErr;
|
|
1514
|
+
declare const core_isOk: typeof isOk;
|
|
1515
|
+
declare const core_ok: typeof ok;
|
|
1516
|
+
declare const core_secureValidate: typeof secureValidate;
|
|
1517
|
+
declare const core_unbrand: typeof unbrand;
|
|
1518
|
+
declare const core_untrusted: typeof untrusted;
|
|
1519
|
+
declare const core_validateWithSchema: typeof validateWithSchema;
|
|
1520
|
+
declare const core_validated: typeof validated;
|
|
1521
|
+
declare const core_withRetry: typeof withRetry;
|
|
1522
|
+
declare namespace core {
|
|
1523
|
+
export { type core_CircuitBreakerOptions as CircuitBreakerOptions, type core_DAG as DAG, type core_DAGEdge as DAGEdge, type core_DAGNode as DAGNode, type core_EventHandler as EventHandler, type core_Registry as Registry, type core_RetryOptions as RetryOptions, type core_SDKResult as SDKResult, type core_StoreError as StoreError, type core_TypedEventBus as TypedEventBus, type core_Untrusted as Untrusted, type core_Validated as Validated, core_createCircuitBreaker as createCircuitBreaker, core_createDAG as createDAG, core_createEventBus as createEventBus, core_createRegistry as createRegistry, core_err as err, flatMap as flatMapResult, core_isErr as isErr, core_isOk as isOk, map as mapResult, core_ok as ok, core_secureValidate as secureValidate, core_unbrand as unbrand, core_untrusted as untrusted, core_validateWithSchema as validateWithSchema, core_validated as validated, core_withRetry as withRetry };
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1493
1526
|
/**
|
|
1494
|
-
*
|
|
1527
|
+
* L0 Category Theory Primitives
|
|
1495
1528
|
*
|
|
1496
|
-
*
|
|
1529
|
+
* Foundational categorical abstractions for cross-layer type mappings.
|
|
1530
|
+
* Provides the mathematical foundation for isomorphisms between AXON layers.
|
|
1497
1531
|
*
|
|
1498
|
-
* @
|
|
1499
|
-
*
|
|
1500
|
-
*
|
|
1501
|
-
* scope: "stack",
|
|
1502
|
-
* env: "OPENAI_API_KEY",
|
|
1503
|
-
* required: true
|
|
1504
|
-
* };
|
|
1532
|
+
* @license BUSL-1.1
|
|
1533
|
+
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
1534
|
+
* @module core/L0/category
|
|
1505
1535
|
*/
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1536
|
+
/**
|
|
1537
|
+
* A morphism is a structure-preserving transformation between types.
|
|
1538
|
+
* This is the fundamental building block of category theory.
|
|
1539
|
+
*/
|
|
1540
|
+
type Morphism<A, B> = (a: A) => B;
|
|
1541
|
+
/**
|
|
1542
|
+
* Async morphism for transformations that may be asynchronous
|
|
1543
|
+
*/
|
|
1544
|
+
type AsyncMorphism<A, B> = (a: A) => Promise<B>;
|
|
1545
|
+
/**
|
|
1546
|
+
* A Category consists of objects and morphisms between them,
|
|
1547
|
+
* with composition and identity laws.
|
|
1548
|
+
*/
|
|
1549
|
+
interface Category<Obj, Hom> {
|
|
1550
|
+
/** Identity morphism for each object */
|
|
1551
|
+
identity<A extends Obj>(a: A): Hom;
|
|
1552
|
+
/** Composition of morphisms: g . f = g(f(x)) */
|
|
1553
|
+
compose<A extends Obj, B extends Obj, C extends Obj>(f: Hom, g: Hom): Hom;
|
|
1515
1554
|
}
|
|
1516
1555
|
/**
|
|
1517
|
-
*
|
|
1518
|
-
*
|
|
1519
|
-
*
|
|
1520
|
-
*
|
|
1521
|
-
*
|
|
1522
|
-
* @example
|
|
1523
|
-
* const entrypoints: NodeEntrypoints = {
|
|
1524
|
-
* worker: { module: "./transform.js", export: "transform" },
|
|
1525
|
-
* edge: { endpoint: "https://api.example.com/process" }
|
|
1526
|
-
* };
|
|
1556
|
+
* An isomorphism is a bijective morphism with an inverse.
|
|
1557
|
+
* For A and B to be isomorphic, there must exist:
|
|
1558
|
+
* - forward: A → B
|
|
1559
|
+
* - backward: B → A
|
|
1560
|
+
* - such that: backward(forward(a)) = a AND forward(backward(b)) = b
|
|
1527
1561
|
*/
|
|
1528
|
-
interface
|
|
1529
|
-
/**
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
"container-lite"?: {
|
|
1536
|
-
command: string;
|
|
1537
|
-
args?: string[];
|
|
1538
|
-
cwd?: string;
|
|
1539
|
-
};
|
|
1540
|
-
/** WebContainer entrypoint */
|
|
1541
|
-
webcontainer?: {
|
|
1542
|
-
command: string;
|
|
1543
|
-
args?: string[];
|
|
1544
|
-
cwd?: string;
|
|
1545
|
-
};
|
|
1546
|
-
/** WASM HVM entrypoint */
|
|
1547
|
-
"wasm-hvm"?: {
|
|
1548
|
-
module: string;
|
|
1549
|
-
function?: string;
|
|
1550
|
-
};
|
|
1551
|
-
/** Edge function entrypoint */
|
|
1552
|
-
edge?: {
|
|
1553
|
-
endpoint: string;
|
|
1554
|
-
};
|
|
1562
|
+
interface Iso<A, B> {
|
|
1563
|
+
/** Forward transformation: A → B */
|
|
1564
|
+
forward: Morphism<A, B>;
|
|
1565
|
+
/** Backward transformation: B → A */
|
|
1566
|
+
backward: Morphism<B, A>;
|
|
1567
|
+
/** Optional metadata about the isomorphism */
|
|
1568
|
+
meta?: IsoMeta;
|
|
1555
1569
|
}
|
|
1556
1570
|
/**
|
|
1557
|
-
*
|
|
1558
|
-
*
|
|
1559
|
-
* @internal
|
|
1571
|
+
* Metadata about an isomorphism
|
|
1560
1572
|
*/
|
|
1561
|
-
interface
|
|
1562
|
-
/** Unique identifier (must be stable across versions) */
|
|
1563
|
-
id: string;
|
|
1564
|
-
/** Semantic version (e.g., "1.0.0") */
|
|
1565
|
-
version: string;
|
|
1573
|
+
interface IsoMeta {
|
|
1566
1574
|
/** Human-readable name */
|
|
1567
1575
|
name?: string;
|
|
1568
|
-
/** Description of
|
|
1576
|
+
/** Description of what this iso does */
|
|
1569
1577
|
description?: string;
|
|
1570
|
-
/**
|
|
1571
|
-
|
|
1572
|
-
/**
|
|
1573
|
-
|
|
1578
|
+
/** Whether this is an exact isomorphism (no information loss) */
|
|
1579
|
+
exact?: boolean;
|
|
1580
|
+
/** Confidence score for derived isomorphisms (0-1) */
|
|
1581
|
+
confidence?: number;
|
|
1582
|
+
/** Source layer (L1-L5) */
|
|
1583
|
+
sourceLayer?: LayerId;
|
|
1584
|
+
/** Target layer (L1-L5) */
|
|
1585
|
+
targetLayer?: LayerId;
|
|
1574
1586
|
}
|
|
1575
1587
|
/**
|
|
1576
|
-
*
|
|
1577
|
-
*
|
|
1578
|
-
* Defines a single computational node in a workflow.
|
|
1579
|
-
* Nodes are atomic execution units with typed inputs/outputs.
|
|
1580
|
-
*
|
|
1581
|
-
* @example
|
|
1582
|
-
* const node: NodeManifestV0 = {
|
|
1583
|
-
* id: "llm-transform",
|
|
1584
|
-
* version: "1.0.0",
|
|
1585
|
-
* kind: "transform",
|
|
1586
|
-
* runtimes: ["worker", "edge"],
|
|
1587
|
-
* entrypoints: {
|
|
1588
|
-
* worker: { module: "./llm.js", export: "transform" }
|
|
1589
|
-
* },
|
|
1590
|
-
* inputsSchema: {
|
|
1591
|
-
* type: "object",
|
|
1592
|
-
* properties: {
|
|
1593
|
-
* prompt: { type: "string" }
|
|
1594
|
-
* },
|
|
1595
|
-
* required: ["prompt"]
|
|
1596
|
-
* },
|
|
1597
|
-
* outputsSchema: {
|
|
1598
|
-
* type: "object",
|
|
1599
|
-
* properties: {
|
|
1600
|
-
* text: { type: "string" }
|
|
1601
|
-
* }
|
|
1602
|
-
* }
|
|
1603
|
-
* };
|
|
1588
|
+
* Async isomorphism for transformations that may be asynchronous
|
|
1604
1589
|
*/
|
|
1605
|
-
interface
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
label?: string;
|
|
1610
|
-
/** Supported runtime tiers (in priority order) */
|
|
1611
|
-
runtimes: RuntimeTier[];
|
|
1612
|
-
/** Runtime-specific execution entrypoints */
|
|
1613
|
-
entrypoints: NodeEntrypoints;
|
|
1614
|
-
/** JSON Schema for input validation */
|
|
1615
|
-
inputsSchema?: JSONSchema7;
|
|
1616
|
-
/** JSON Schema for output validation */
|
|
1617
|
-
outputsSchema?: JSONSchema7;
|
|
1618
|
-
/** Declared capabilities (e.g., "network", "filesystem") */
|
|
1619
|
-
capabilities?: string[];
|
|
1620
|
-
/** Secret references required by this node */
|
|
1621
|
-
secrets?: NodeSecretRef[];
|
|
1622
|
-
/** Lifecycle hooks for instrumentation */
|
|
1623
|
-
hooks?: {
|
|
1624
|
-
explain?: string;
|
|
1625
|
-
debug?: string;
|
|
1626
|
-
askInput?: string;
|
|
1627
|
-
};
|
|
1628
|
-
/** UI configuration */
|
|
1629
|
-
ui?: {
|
|
1630
|
-
/** Node-specific UI config */
|
|
1631
|
-
config?: unknown;
|
|
1632
|
-
/** Output viewer configuration */
|
|
1633
|
-
viewer?: {
|
|
1634
|
-
kind?: "text" | "table" | "json" | "custom";
|
|
1635
|
-
componentId?: string;
|
|
1636
|
-
};
|
|
1637
|
-
};
|
|
1638
|
-
/** MCP server integration */
|
|
1639
|
-
mcp?: {
|
|
1640
|
-
/** MCP server identifier */
|
|
1641
|
-
server?: string;
|
|
1642
|
-
/** Exposed MCP tools */
|
|
1643
|
-
tools?: Array<{
|
|
1644
|
-
name: string;
|
|
1645
|
-
schema?: JSONSchema7;
|
|
1646
|
-
}>;
|
|
1647
|
-
};
|
|
1648
|
-
/** Observability configuration */
|
|
1649
|
-
observability?: {
|
|
1650
|
-
/** Emit execution logs */
|
|
1651
|
-
emitLogs?: boolean;
|
|
1652
|
-
/** Emit output artifacts */
|
|
1653
|
-
emitArtifacts?: boolean;
|
|
1654
|
-
/** Trace attribute keys to capture */
|
|
1655
|
-
traceAttributes?: string[];
|
|
1656
|
-
};
|
|
1590
|
+
interface AsyncIso<A, B> {
|
|
1591
|
+
forward: AsyncMorphism<A, B>;
|
|
1592
|
+
backward: AsyncMorphism<B, A>;
|
|
1593
|
+
meta?: IsoMeta;
|
|
1657
1594
|
}
|
|
1658
1595
|
/**
|
|
1659
|
-
*
|
|
1660
|
-
*
|
|
1661
|
-
*
|
|
1662
|
-
*
|
|
1663
|
-
* @example
|
|
1664
|
-
* const secretScope: StackSecretScope = {
|
|
1665
|
-
* scope: ["fetch-node", "transform-node"],
|
|
1666
|
-
* required: true
|
|
1667
|
-
* };
|
|
1596
|
+
* An embedding is a one-way structure-preserving transformation.
|
|
1597
|
+
* Unlike isomorphisms, embeddings may not have a full inverse.
|
|
1598
|
+
* The partial inverse extracts as much as possible from the target type.
|
|
1668
1599
|
*/
|
|
1669
|
-
interface
|
|
1670
|
-
/**
|
|
1671
|
-
|
|
1672
|
-
/**
|
|
1673
|
-
|
|
1600
|
+
interface Embed<A, B> {
|
|
1601
|
+
/** Embed A into B */
|
|
1602
|
+
embed: Morphism<A, B>;
|
|
1603
|
+
/** Partial extraction from B (may lose information) */
|
|
1604
|
+
extract: Morphism<B, Partial<A>>;
|
|
1605
|
+
/** Whether the embedding is lossless */
|
|
1606
|
+
lossless?: boolean;
|
|
1674
1607
|
}
|
|
1675
1608
|
/**
|
|
1676
|
-
*
|
|
1677
|
-
*
|
|
1678
|
-
* Allows stack-wide defaults with per-node overrides.
|
|
1679
|
-
*
|
|
1680
|
-
* @example
|
|
1681
|
-
* const runtimes: StackRuntimes = {
|
|
1682
|
-
* default: ["worker", "edge"],
|
|
1683
|
-
* overrides: {
|
|
1684
|
-
* "heavy-compute": ["container-lite"]
|
|
1685
|
-
* }
|
|
1686
|
-
* };
|
|
1609
|
+
* A functor maps objects and morphisms between categories
|
|
1610
|
+
* while preserving identity and composition.
|
|
1687
1611
|
*/
|
|
1688
|
-
interface
|
|
1689
|
-
/**
|
|
1690
|
-
|
|
1691
|
-
/** Per-node runtime tier overrides (nodeId -> tiers) */
|
|
1692
|
-
overrides?: Record<string, RuntimeTier[]>;
|
|
1612
|
+
interface Functor<F> {
|
|
1613
|
+
/** Map a morphism over the functor */
|
|
1614
|
+
map<A, B>(f: Morphism<A, B>): (fa: F) => F;
|
|
1693
1615
|
}
|
|
1694
1616
|
/**
|
|
1695
|
-
*
|
|
1696
|
-
*
|
|
1697
|
-
*
|
|
1698
|
-
*
|
|
1699
|
-
* @example
|
|
1700
|
-
* const nodeConfig: StackNodeConfig = {
|
|
1701
|
-
* id: "fetch-1",
|
|
1702
|
-
* nodeRef: "http-fetch",
|
|
1703
|
-
* config: { timeout: 5000 },
|
|
1704
|
-
* runtimes: ["edge"],
|
|
1705
|
-
* secrets: ["api_key"]
|
|
1706
|
-
* };
|
|
1617
|
+
* Natural transformation between functors F and G.
|
|
1618
|
+
* For each object A, provides a morphism F(A) → G(A)
|
|
1619
|
+
* such that the naturality square commutes.
|
|
1707
1620
|
*/
|
|
1708
|
-
|
|
1709
|
-
/** Unique ID within stack */
|
|
1710
|
-
id: string;
|
|
1711
|
-
/** Reference to NodeManifestV0.id */
|
|
1712
|
-
nodeRef: string;
|
|
1713
|
-
/** Node-specific configuration */
|
|
1714
|
-
config?: Record<string, unknown>;
|
|
1715
|
-
/** Runtime tier override */
|
|
1716
|
-
runtimes?: RuntimeTier[];
|
|
1717
|
-
/** Security policy override */
|
|
1718
|
-
policies?: NodePolicy;
|
|
1719
|
-
/** Secret names from stack.secrets */
|
|
1720
|
-
secrets?: string[];
|
|
1721
|
-
}
|
|
1621
|
+
type NaturalTransformation<F, G> = <A>(fa: F) => G;
|
|
1722
1622
|
/**
|
|
1723
|
-
*
|
|
1724
|
-
*
|
|
1725
|
-
* Defines data flow from one node's outputs to another's inputs.
|
|
1726
|
-
*
|
|
1727
|
-
* @example
|
|
1728
|
-
* const edge: StackEdge = {
|
|
1729
|
-
* from: "fetch-1",
|
|
1730
|
-
* to: "transform-1",
|
|
1731
|
-
* map: { "data": "input" }
|
|
1732
|
-
* };
|
|
1623
|
+
* AXON Layer identifiers
|
|
1733
1624
|
*/
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1625
|
+
type LayerId = "L0" | "L1" | "L2" | "L3" | "L4" | "L5";
|
|
1626
|
+
/**
|
|
1627
|
+
* Layer metadata
|
|
1628
|
+
*/
|
|
1629
|
+
interface LayerMeta {
|
|
1630
|
+
id: LayerId;
|
|
1631
|
+
name: string;
|
|
1632
|
+
description: string;
|
|
1633
|
+
color: string;
|
|
1741
1634
|
}
|
|
1742
1635
|
/**
|
|
1743
|
-
*
|
|
1744
|
-
*
|
|
1745
|
-
* - `L0`: Landing/Zero layer (low-level primitives)
|
|
1746
|
-
* - `L1`: Compose/Platform layer (higher-level abstractions)
|
|
1636
|
+
* AXON Layer definitions
|
|
1747
1637
|
*/
|
|
1748
|
-
|
|
1749
|
-
/**
|
|
1750
|
-
* Stack manifest for DAG orchestrator.
|
|
1751
|
-
*
|
|
1752
|
-
* Defines a complete workflow as a directed acyclic graph (DAG) of nodes.
|
|
1753
|
-
*
|
|
1754
|
-
* @example
|
|
1755
|
-
* const stack: StackManifestV0 = {
|
|
1756
|
-
* id: "data-pipeline",
|
|
1757
|
-
* version: "1.0.0",
|
|
1758
|
-
* nodes: [
|
|
1759
|
-
* { id: "fetch", nodeRef: "http-fetch", config: { url: "..." } },
|
|
1760
|
-
* { id: "transform", nodeRef: "llm-transform" }
|
|
1761
|
-
* ],
|
|
1762
|
-
* edges: [
|
|
1763
|
-
* { from: "fetch", to: "transform", map: { data: "input" } }
|
|
1764
|
-
* ],
|
|
1765
|
-
* secrets: {
|
|
1766
|
-
* api_key: { scope: ["fetch"], required: true }
|
|
1767
|
-
* }
|
|
1768
|
-
* };
|
|
1769
|
-
*/
|
|
1770
|
-
interface StackManifestV0 extends BaseManifestV0 {
|
|
1771
|
-
/** Node instances in this stack */
|
|
1772
|
-
nodes: StackNodeConfig[];
|
|
1773
|
-
/** Edges connecting nodes (data flow) */
|
|
1774
|
-
edges?: StackEdge[];
|
|
1775
|
-
/** Stack-level secret definitions */
|
|
1776
|
-
secrets?: Record<string, StackSecretScope>;
|
|
1777
|
-
/** Runtime tier configuration */
|
|
1778
|
-
runtimes?: StackRuntimes;
|
|
1779
|
-
/** Provenance layer (L0 or L1) */
|
|
1780
|
-
layer?: ManifestLayer;
|
|
1781
|
-
}
|
|
1782
|
-
|
|
1783
|
-
/**
|
|
1784
|
-
* Skill Manifest Types (L1)
|
|
1785
|
-
*
|
|
1786
|
-
* Core types for the Skills Platform. A SkillManifest extends StackManifestV0
|
|
1787
|
-
* with skill-specific metadata — a skill IS a stack with agent orchestration.
|
|
1788
|
-
*
|
|
1789
|
-
* @module skills/types
|
|
1790
|
-
*/
|
|
1791
|
-
|
|
1792
|
-
type SkillCategory = "startup" | "legal" | "finance" | "engineering" | "content" | "research" | "operations" | "marketing" | "verification";
|
|
1793
|
-
type SkillOutputType = "document" | "website" | "spreadsheet" | "presentation" | "codebase" | "analysis" | "dataset" | "visual" | "video" | "audio" | "composite";
|
|
1794
|
-
declare const SKILL_TIERS: readonly ["flagship", "professional", "utility"];
|
|
1795
|
-
type SkillTier = (typeof SKILL_TIERS)[number];
|
|
1796
|
-
declare const SKILL_RANKS: readonly ["skill", "flow", "fleet", "org", "society"];
|
|
1797
|
-
type SkillRank = (typeof SKILL_RANKS)[number];
|
|
1798
|
-
/** Effective-dated rank assignment — immutable audit trail */
|
|
1799
|
-
interface RankAssignment {
|
|
1800
|
-
/** Current rank */
|
|
1801
|
-
rank: SkillRank;
|
|
1802
|
-
/** ISO 8601 timestamp when this rank became effective */
|
|
1803
|
-
effectiveFrom: string;
|
|
1804
|
-
/** ISO 8601 timestamp when this rank was superseded (null = current) */
|
|
1805
|
-
effectiveTo: string | null;
|
|
1806
|
-
/** Evidence that promotion invariants were satisfied */
|
|
1807
|
-
proof?: PromotionProof;
|
|
1808
|
-
}
|
|
1809
|
-
/**
|
|
1810
|
-
* Promotion proof — the Curry-Howard witness type.
|
|
1811
|
-
* Each promotion requires structural evidence that the entity
|
|
1812
|
-
* satisfies the invariants of the target rank.
|
|
1813
|
-
*/
|
|
1814
|
-
interface PromotionProof {
|
|
1815
|
-
/** Source rank */
|
|
1816
|
-
from: SkillRank;
|
|
1817
|
-
/** Target rank */
|
|
1818
|
-
to: SkillRank;
|
|
1819
|
-
/** Structural invariant checks that passed */
|
|
1820
|
-
invariants: PromotionInvariant[];
|
|
1821
|
-
/** Timestamp of promotion evaluation */
|
|
1822
|
-
evaluatedAt: string;
|
|
1823
|
-
/** Quality score at time of promotion (0-1) */
|
|
1824
|
-
qualityScore: number;
|
|
1825
|
-
}
|
|
1826
|
-
interface PromotionInvariant {
|
|
1827
|
-
/** Invariant name (e.g., "has_convergence", "has_3_plus_skills", "has_mesh_events") */
|
|
1828
|
-
name: string;
|
|
1829
|
-
/** Whether this invariant was satisfied */
|
|
1830
|
-
satisfied: boolean;
|
|
1831
|
-
/** Human-readable evidence */
|
|
1832
|
-
evidence?: string;
|
|
1833
|
-
}
|
|
1834
|
-
interface SkillCapabilities {
|
|
1835
|
-
/** Allow image generation via connected media providers */
|
|
1836
|
-
allowImageGen?: boolean;
|
|
1837
|
-
/** Allow video generation via connected media providers */
|
|
1838
|
-
allowVideoGen?: boolean;
|
|
1839
|
-
/** Allow MCP tool access during execution */
|
|
1840
|
-
allowTools?: boolean;
|
|
1841
|
-
/** Allow web search during execution */
|
|
1842
|
-
allowWebSearch?: boolean;
|
|
1843
|
-
/** Allow code execution in sandbox */
|
|
1844
|
-
allowCodeExec?: boolean;
|
|
1845
|
-
}
|
|
1846
|
-
interface SkillAgent {
|
|
1847
|
-
/** Agent role name (e.g., "Market Researcher", "Legal Analyst") */
|
|
1848
|
-
role: string;
|
|
1849
|
-
/** What this agent does in the workflow */
|
|
1850
|
-
description: string;
|
|
1851
|
-
/** Maps to a NodeManifestV0.id in the stack */
|
|
1852
|
-
nodeRef?: string;
|
|
1853
|
-
/** When true, a synthetic peer reviewer evaluates this agent's output after completion */
|
|
1854
|
-
peerReview?: boolean;
|
|
1855
|
-
}
|
|
1856
|
-
interface SkillSampleOutput {
|
|
1857
|
-
type: SkillOutputType;
|
|
1858
|
-
title: string;
|
|
1859
|
-
/** Screenshot or live preview URL */
|
|
1860
|
-
previewUrl?: string;
|
|
1861
|
-
description: string;
|
|
1862
|
-
}
|
|
1863
|
-
/** External service dependency for a skill */
|
|
1864
|
-
interface SkillServiceRequirement {
|
|
1865
|
-
/** Unique key for this requirement (e.g., "search", "database", "email") */
|
|
1866
|
-
key: string;
|
|
1867
|
-
/** Human-readable label */
|
|
1868
|
-
label: string;
|
|
1869
|
-
/** Type of service needed */
|
|
1870
|
-
type: "mcp" | "api" | "credential";
|
|
1871
|
-
/** Description of what this service is used for */
|
|
1872
|
-
description: string;
|
|
1873
|
-
/** Whether this service is required or optional */
|
|
1874
|
-
required: boolean;
|
|
1875
|
-
/** Suggested MCP server names (for type: "mcp") */
|
|
1876
|
-
suggestedServers?: string[];
|
|
1877
|
-
}
|
|
1878
|
-
interface SkillMeta<TInput extends Record<string, unknown> = Record<string, unknown>> {
|
|
1879
|
-
/** Unique skill slug (url-safe) */
|
|
1880
|
-
slug: string;
|
|
1881
|
-
/** Display name */
|
|
1882
|
-
title: string;
|
|
1883
|
-
/** One-line value proposition */
|
|
1884
|
-
tagline: string;
|
|
1885
|
-
/** Detailed description (markdown) */
|
|
1886
|
-
description: string;
|
|
1887
|
-
/** Skill category */
|
|
1888
|
-
category: SkillCategory;
|
|
1889
|
-
/** Skill tier (complexity/impact level) */
|
|
1890
|
-
tier: SkillTier;
|
|
1891
|
-
/** Expected output artifact types */
|
|
1892
|
-
outputs: SkillOutputType[];
|
|
1893
|
-
/** Estimated execution time range in seconds [min, max] */
|
|
1894
|
-
estimatedTime: [number, number];
|
|
1895
|
-
/** Required input schema (JSON Schema) */
|
|
1896
|
-
inputSchema: JSONSchema7;
|
|
1897
|
-
/** Agent roles involved in this skill */
|
|
1898
|
-
agents: SkillAgent[];
|
|
1899
|
-
/** Sample input for demo/preview (typed to match inputSchema) */
|
|
1900
|
-
sampleInput?: TInput;
|
|
1901
|
-
/** Sample output artifacts for showcase */
|
|
1902
|
-
sampleOutputs?: SkillSampleOutput[];
|
|
1903
|
-
/** Tags for filtering */
|
|
1904
|
-
tags: string[];
|
|
1905
|
-
/** Author */
|
|
1906
|
-
author: string;
|
|
1907
|
-
/** Icon identifier (from icon set) */
|
|
1908
|
-
icon?: string;
|
|
1909
|
-
/** Cosmic gradient pair index (0-7 from cosmicGradients) */
|
|
1910
|
-
gradientIndex?: number;
|
|
1911
|
-
/** Output schema for composition chaining (JSON Schema) */
|
|
1912
|
-
outputSchema?: JSONSchema7;
|
|
1913
|
-
/** Allow agents to dynamically delegate tasks to ephemeral agents. Max 2 per run. */
|
|
1914
|
-
allowDelegation?: boolean;
|
|
1915
|
-
/** External service dependencies (MCP servers, APIs, credentials) */
|
|
1916
|
-
services?: SkillServiceRequirement[];
|
|
1917
|
-
/** Runtime capability toggles (image gen, video gen, tools, etc.) */
|
|
1918
|
-
capabilities?: SkillCapabilities;
|
|
1919
|
-
/** Current rank in the hierarchy (default: "skill") */
|
|
1920
|
-
rank?: SkillRank;
|
|
1921
|
-
/** Effective-dated rank history — immutable audit trail */
|
|
1922
|
-
rankHistory?: RankAssignment[];
|
|
1923
|
-
/**
|
|
1924
|
-
* Convergence configuration for iterative agent output refinement.
|
|
1925
|
-
*
|
|
1926
|
-
* Future optimization: the manual convergence loop in runner.ts could be
|
|
1927
|
-
* replaced by `withRetry()` + `withCircuitBreaker()` from
|
|
1928
|
-
* `lib/terminals-tech/core/primitives/middleware` — they provide the same
|
|
1929
|
-
* retry/backoff/threshold semantics with composable middleware chaining.
|
|
1930
|
-
* See also `createRefinementLoop()` from `primitives/refinement` which
|
|
1931
|
-
* encapsulates the score/delta/plateau logic as a standalone primitive.
|
|
1932
|
-
*/
|
|
1933
|
-
convergence?: {
|
|
1934
|
-
/** Max refinement iterations per agent. Default 1 (no refinement), max 5. */
|
|
1935
|
-
maxIterations: number;
|
|
1936
|
-
/** Quality threshold (0-1). Agent output must meet this to pass. Default 0.7. */
|
|
1937
|
-
qualityThreshold: number;
|
|
1938
|
-
/** Minimum quality improvement per iteration. Stops early if delta < this. Default 0.05. */
|
|
1939
|
-
minDelta: number;
|
|
1940
|
-
/** Refinement strategy: retry (re-execute), critique (LLM critic), refine (critique + inject feedback). */
|
|
1941
|
-
strategy: "retry" | "critique" | "refine";
|
|
1942
|
-
};
|
|
1943
|
-
}
|
|
1944
|
-
/**
|
|
1945
|
-
* A SkillManifest extends StackManifestV0 with skill-specific metadata.
|
|
1946
|
-
*
|
|
1947
|
-
* This is the core type — a skill IS a stack manifest with agent orchestration
|
|
1948
|
-
* metadata. The `skill` field contains all presentation and execution metadata.
|
|
1949
|
-
*
|
|
1950
|
-
* The `TInput` parameter establishes compile-time correspondence between
|
|
1951
|
-
* the JSON Schema `inputSchema`, the typed `sampleInput`, and the runtime
|
|
1952
|
-
* input validated by `SkillRunner.start()`.
|
|
1953
|
-
*/
|
|
1954
|
-
interface SkillManifest<TInput extends Record<string, unknown> = Record<string, unknown>> extends StackManifestV0 {
|
|
1955
|
-
/** Skill-specific metadata */
|
|
1956
|
-
skill: SkillMeta<TInput>;
|
|
1957
|
-
}
|
|
1958
|
-
|
|
1959
|
-
type ManifestType = "skill" | "stack" | "node" | "project";
|
|
1960
|
-
type ManifestSource = "system" | "user" | "compose" | "marketplace" | "import";
|
|
1961
|
-
interface RegistryEntry {
|
|
1962
|
-
type: ManifestType;
|
|
1963
|
-
manifest: SkillManifest | StackManifestV0 | NodeManifestV0 | Record<string, unknown>;
|
|
1964
|
-
source: ManifestSource;
|
|
1965
|
-
registeredAt: number;
|
|
1966
|
-
tags?: string[];
|
|
1967
|
-
}
|
|
1968
|
-
interface RegistryFilter {
|
|
1969
|
-
type?: ManifestType;
|
|
1970
|
-
source?: ManifestSource;
|
|
1971
|
-
category?: SkillCategory;
|
|
1972
|
-
tags?: string[];
|
|
1973
|
-
limit?: number;
|
|
1974
|
-
}
|
|
1975
|
-
declare class ManifestRegistry {
|
|
1976
|
-
private entries;
|
|
1977
|
-
register(manifest: SkillManifest | StackManifestV0 | NodeManifestV0 | Record<string, unknown>, type: ManifestType, source: ManifestSource, tags?: string[]): void;
|
|
1978
|
-
get(key: string): RegistryEntry | undefined;
|
|
1979
|
-
getSkill(slug: string): SkillManifest | undefined;
|
|
1980
|
-
getAll(filter?: RegistryFilter): RegistryEntry[];
|
|
1981
|
-
resolve(ref: string): RegistryEntry | null;
|
|
1982
|
-
search(query: string, filter?: RegistryFilter): RegistryEntry[];
|
|
1983
|
-
unregister(key: string): boolean;
|
|
1984
|
-
get size(): number;
|
|
1985
|
-
clear(): void;
|
|
1986
|
-
private deriveKey;
|
|
1987
|
-
}
|
|
1988
|
-
/** Singleton registry instance */
|
|
1989
|
-
declare const registry: ManifestRegistry;
|
|
1990
|
-
|
|
1991
|
-
/**
|
|
1992
|
-
* Core SDK — Fundamental utilities and data structures
|
|
1993
|
-
*
|
|
1994
|
-
* Result types, retry/circuit-breaker, event bus, validation, DAG, registry.
|
|
1995
|
-
* Hides internal combinators, vector ops, stream internals.
|
|
1996
|
-
*
|
|
1997
|
-
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
1998
|
-
* @module sdk/core
|
|
1999
|
-
*/
|
|
2000
|
-
|
|
2001
|
-
type core_CircuitBreakerOptions = CircuitBreakerOptions;
|
|
2002
|
-
type core_DAG<N, E = void> = DAG<N, E>;
|
|
2003
|
-
type core_DAGEdge<E = void> = DAGEdge<E>;
|
|
2004
|
-
type core_DAGNode<T> = DAGNode<T>;
|
|
2005
|
-
type core_EventHandler<T> = EventHandler<T>;
|
|
2006
|
-
type core_ManifestRegistry = ManifestRegistry;
|
|
2007
|
-
declare const core_ManifestRegistry: typeof ManifestRegistry;
|
|
2008
|
-
type core_Registry<K, V> = Registry<K, V>;
|
|
2009
|
-
type core_RetryOptions = RetryOptions;
|
|
2010
|
-
type core_SDKResult<T, E = Error> = SDKResult<T, E>;
|
|
2011
|
-
type core_StoreError = StoreError;
|
|
2012
|
-
type core_TypedEventBus<Events extends Record<string, unknown>> = TypedEventBus<Events>;
|
|
2013
|
-
type core_Untrusted<T> = Untrusted<T>;
|
|
2014
|
-
type core_Validated<T> = Validated<T>;
|
|
2015
|
-
declare const core_createCircuitBreaker: typeof createCircuitBreaker;
|
|
2016
|
-
declare const core_createDAG: typeof createDAG;
|
|
2017
|
-
declare const core_createEventBus: typeof createEventBus;
|
|
2018
|
-
declare const core_createRegistry: typeof createRegistry;
|
|
2019
|
-
declare const core_err: typeof err;
|
|
2020
|
-
declare const core_isErr: typeof isErr;
|
|
2021
|
-
declare const core_isOk: typeof isOk;
|
|
2022
|
-
declare const core_ok: typeof ok;
|
|
2023
|
-
declare const core_registry: typeof registry;
|
|
2024
|
-
declare const core_secureValidate: typeof secureValidate;
|
|
2025
|
-
declare const core_unbrand: typeof unbrand;
|
|
2026
|
-
declare const core_untrusted: typeof untrusted;
|
|
2027
|
-
declare const core_validateWithSchema: typeof validateWithSchema;
|
|
2028
|
-
declare const core_validated: typeof validated;
|
|
2029
|
-
declare const core_withRetry: typeof withRetry;
|
|
2030
|
-
declare namespace core {
|
|
2031
|
-
export { type core_CircuitBreakerOptions as CircuitBreakerOptions, type core_DAG as DAG, type core_DAGEdge as DAGEdge, type core_DAGNode as DAGNode, type core_EventHandler as EventHandler, core_ManifestRegistry as ManifestRegistry, type core_Registry as Registry, type core_RetryOptions as RetryOptions, type core_SDKResult as SDKResult, type core_StoreError as StoreError, type core_TypedEventBus as TypedEventBus, type core_Untrusted as Untrusted, type core_Validated as Validated, core_createCircuitBreaker as createCircuitBreaker, core_createDAG as createDAG, core_createEventBus as createEventBus, core_createRegistry as createRegistry, core_err as err, flatMap as flatMapResult, core_isErr as isErr, core_isOk as isOk, map as mapResult, core_ok as ok, core_registry as registry, core_secureValidate as secureValidate, core_unbrand as unbrand, core_untrusted as untrusted, core_validateWithSchema as validateWithSchema, core_validated as validated, core_withRetry as withRetry };
|
|
2032
|
-
}
|
|
2033
|
-
|
|
2034
|
-
/**
|
|
2035
|
-
* L0 Category Theory Primitives
|
|
2036
|
-
*
|
|
2037
|
-
* Foundational categorical abstractions for cross-layer type mappings.
|
|
2038
|
-
* Provides the mathematical foundation for isomorphisms between AXON layers.
|
|
2039
|
-
*
|
|
2040
|
-
* @license BUSL-1.1
|
|
2041
|
-
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
2042
|
-
* @module core/L0/category
|
|
2043
|
-
*/
|
|
2044
|
-
/**
|
|
2045
|
-
* A morphism is a structure-preserving transformation between types.
|
|
2046
|
-
* This is the fundamental building block of category theory.
|
|
2047
|
-
*/
|
|
2048
|
-
type Morphism<A, B> = (a: A) => B;
|
|
2049
|
-
/**
|
|
2050
|
-
* Async morphism for transformations that may be asynchronous
|
|
2051
|
-
*/
|
|
2052
|
-
type AsyncMorphism<A, B> = (a: A) => Promise<B>;
|
|
2053
|
-
/**
|
|
2054
|
-
* A Category consists of objects and morphisms between them,
|
|
2055
|
-
* with composition and identity laws.
|
|
2056
|
-
*/
|
|
2057
|
-
interface Category<Obj, Hom> {
|
|
2058
|
-
/** Identity morphism for each object */
|
|
2059
|
-
identity<A extends Obj>(a: A): Hom;
|
|
2060
|
-
/** Composition of morphisms: g . f = g(f(x)) */
|
|
2061
|
-
compose<A extends Obj, B extends Obj, C extends Obj>(f: Hom, g: Hom): Hom;
|
|
2062
|
-
}
|
|
2063
|
-
/**
|
|
2064
|
-
* An isomorphism is a bijective morphism with an inverse.
|
|
2065
|
-
* For A and B to be isomorphic, there must exist:
|
|
2066
|
-
* - forward: A → B
|
|
2067
|
-
* - backward: B → A
|
|
2068
|
-
* - such that: backward(forward(a)) = a AND forward(backward(b)) = b
|
|
2069
|
-
*/
|
|
2070
|
-
interface Iso<A, B> {
|
|
2071
|
-
/** Forward transformation: A → B */
|
|
2072
|
-
forward: Morphism<A, B>;
|
|
2073
|
-
/** Backward transformation: B → A */
|
|
2074
|
-
backward: Morphism<B, A>;
|
|
2075
|
-
/** Optional metadata about the isomorphism */
|
|
2076
|
-
meta?: IsoMeta;
|
|
2077
|
-
}
|
|
2078
|
-
/**
|
|
2079
|
-
* Metadata about an isomorphism
|
|
2080
|
-
*/
|
|
2081
|
-
interface IsoMeta {
|
|
2082
|
-
/** Human-readable name */
|
|
2083
|
-
name?: string;
|
|
2084
|
-
/** Description of what this iso does */
|
|
2085
|
-
description?: string;
|
|
2086
|
-
/** Whether this is an exact isomorphism (no information loss) */
|
|
2087
|
-
exact?: boolean;
|
|
2088
|
-
/** Confidence score for derived isomorphisms (0-1) */
|
|
2089
|
-
confidence?: number;
|
|
2090
|
-
/** Source layer (L1-L5) */
|
|
2091
|
-
sourceLayer?: LayerId;
|
|
2092
|
-
/** Target layer (L1-L5) */
|
|
2093
|
-
targetLayer?: LayerId;
|
|
2094
|
-
}
|
|
2095
|
-
/**
|
|
2096
|
-
* Async isomorphism for transformations that may be asynchronous
|
|
2097
|
-
*/
|
|
2098
|
-
interface AsyncIso<A, B> {
|
|
2099
|
-
forward: AsyncMorphism<A, B>;
|
|
2100
|
-
backward: AsyncMorphism<B, A>;
|
|
2101
|
-
meta?: IsoMeta;
|
|
2102
|
-
}
|
|
2103
|
-
/**
|
|
2104
|
-
* An embedding is a one-way structure-preserving transformation.
|
|
2105
|
-
* Unlike isomorphisms, embeddings may not have a full inverse.
|
|
2106
|
-
* The partial inverse extracts as much as possible from the target type.
|
|
2107
|
-
*/
|
|
2108
|
-
interface Embed<A, B> {
|
|
2109
|
-
/** Embed A into B */
|
|
2110
|
-
embed: Morphism<A, B>;
|
|
2111
|
-
/** Partial extraction from B (may lose information) */
|
|
2112
|
-
extract: Morphism<B, Partial<A>>;
|
|
2113
|
-
/** Whether the embedding is lossless */
|
|
2114
|
-
lossless?: boolean;
|
|
2115
|
-
}
|
|
2116
|
-
/**
|
|
2117
|
-
* A functor maps objects and morphisms between categories
|
|
2118
|
-
* while preserving identity and composition.
|
|
2119
|
-
*/
|
|
2120
|
-
interface Functor<F> {
|
|
2121
|
-
/** Map a morphism over the functor */
|
|
2122
|
-
map<A, B>(f: Morphism<A, B>): (fa: F) => F;
|
|
2123
|
-
}
|
|
2124
|
-
/**
|
|
2125
|
-
* Natural transformation between functors F and G.
|
|
2126
|
-
* For each object A, provides a morphism F(A) → G(A)
|
|
2127
|
-
* such that the naturality square commutes.
|
|
2128
|
-
*/
|
|
2129
|
-
type NaturalTransformation<F, G> = <A>(fa: F) => G;
|
|
2130
|
-
/**
|
|
2131
|
-
* AXON Layer identifiers
|
|
2132
|
-
*/
|
|
2133
|
-
type LayerId = "L0" | "L1" | "L2" | "L3" | "L4" | "L5";
|
|
2134
|
-
/**
|
|
2135
|
-
* Layer metadata
|
|
2136
|
-
*/
|
|
2137
|
-
interface LayerMeta {
|
|
2138
|
-
id: LayerId;
|
|
2139
|
-
name: string;
|
|
2140
|
-
description: string;
|
|
2141
|
-
color: string;
|
|
2142
|
-
}
|
|
2143
|
-
/**
|
|
2144
|
-
* AXON Layer definitions
|
|
2145
|
-
*/
|
|
2146
|
-
declare const LAYERS: Record<LayerId, LayerMeta>;
|
|
1638
|
+
declare const LAYERS: Record<LayerId, LayerMeta>;
|
|
2147
1639
|
/**
|
|
2148
1640
|
* Valid layer transitions in the AXON architecture
|
|
2149
1641
|
*/
|
|
@@ -2250,818 +1742,1286 @@ declare function entropy(probabilities: number[]): number;
|
|
|
2250
1742
|
* @param jointProbabilities - 2D array of joint probabilities P(X=x, Y=y)
|
|
2251
1743
|
* @returns Joint entropy in bits
|
|
2252
1744
|
*/
|
|
2253
|
-
declare function jointEntropy(jointProbabilities: number[][]): number;
|
|
1745
|
+
declare function jointEntropy(jointProbabilities: number[][]): number;
|
|
1746
|
+
/**
|
|
1747
|
+
* Calculate conditional entropy H(Y|X) = H(X,Y) - H(X)
|
|
1748
|
+
*
|
|
1749
|
+
* @param jointProbabilities - 2D array P(X=x, Y=y)
|
|
1750
|
+
* @returns Conditional entropy in bits
|
|
1751
|
+
*/
|
|
1752
|
+
declare function conditionalEntropy(jointProbabilities: number[][]): number;
|
|
1753
|
+
/**
|
|
1754
|
+
* Calculate mutual information I(X; Y) = H(X) + H(Y) - H(X, Y)
|
|
1755
|
+
* Measures how much knowing one variable reduces uncertainty about the other.
|
|
1756
|
+
*
|
|
1757
|
+
* @param pX - Marginal probability of X
|
|
1758
|
+
* @param pY - Marginal probability of Y
|
|
1759
|
+
* @param pXY - Joint probability P(X, Y) as 2D array
|
|
1760
|
+
* @returns Mutual information in bits
|
|
1761
|
+
*/
|
|
1762
|
+
declare function mutualInformation(pX: number[], pY: number[], pXY: number[][]): number;
|
|
1763
|
+
/**
|
|
1764
|
+
* Metrics for measuring information preservation in transformations
|
|
1765
|
+
*/
|
|
1766
|
+
interface InformationPreservation {
|
|
1767
|
+
/** Fraction of source information retained (0-1) */
|
|
1768
|
+
retention: number;
|
|
1769
|
+
/** Entropy of the source */
|
|
1770
|
+
sourceEntropy: number;
|
|
1771
|
+
/** Entropy of the target */
|
|
1772
|
+
targetEntropy: number;
|
|
1773
|
+
/** Mutual information between source and target */
|
|
1774
|
+
mutualInfo: number;
|
|
1775
|
+
/** Whether the transformation is lossless */
|
|
1776
|
+
lossless: boolean;
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* Measure information preservation between source and transformed representations.
|
|
1780
|
+
* Uses hash-based sampling for large datasets.
|
|
1781
|
+
*
|
|
1782
|
+
* @param source - Original values
|
|
1783
|
+
* @param transformed - Transformed values
|
|
1784
|
+
* @param roundTrip - Optional round-trip values (transformed → source)
|
|
1785
|
+
* @returns Information preservation metrics
|
|
1786
|
+
*/
|
|
1787
|
+
declare function measurePreservation<S, T>(source: S[], transformed: T[], roundTrip?: S[]): InformationPreservation;
|
|
1788
|
+
/**
|
|
1789
|
+
* Semantic density measures bits of meaningful information per token.
|
|
1790
|
+
* Higher density = more information packed into fewer tokens.
|
|
1791
|
+
*/
|
|
1792
|
+
interface SemanticDensity {
|
|
1793
|
+
/** Total tokens in the representation */
|
|
1794
|
+
tokenCount: number;
|
|
1795
|
+
/** Estimated information content in bits */
|
|
1796
|
+
informationBits: number;
|
|
1797
|
+
/** Bits per token */
|
|
1798
|
+
density: number;
|
|
1799
|
+
/** Compression ratio compared to baseline */
|
|
1800
|
+
compressionRatio: number;
|
|
1801
|
+
}
|
|
1802
|
+
/**
|
|
1803
|
+
* Calculate semantic density of a representation.
|
|
1804
|
+
*
|
|
1805
|
+
* @param tokens - Array of tokens (strings, symbols, etc.)
|
|
1806
|
+
* @param baselineTokensPerBit - Baseline tokens per bit of information (default: 2)
|
|
1807
|
+
* @returns Semantic density metrics
|
|
1808
|
+
*/
|
|
1809
|
+
declare function calculateSemanticDensity(tokens: string[], baselineTokensPerBit?: number): SemanticDensity;
|
|
1810
|
+
/**
|
|
1811
|
+
* Estimate Kolmogorov complexity via compression.
|
|
1812
|
+
* Lower complexity = more compressible = more structured.
|
|
1813
|
+
*
|
|
1814
|
+
* @param data - String representation of data
|
|
1815
|
+
* @returns Estimated complexity as compression ratio
|
|
1816
|
+
*/
|
|
1817
|
+
declare function estimateComplexity(data: string): number;
|
|
1818
|
+
/**
|
|
1819
|
+
* Calculate KL divergence D_KL(P || Q) = Σ p(x) log(p(x)/q(x))
|
|
1820
|
+
* Measures how much P differs from Q.
|
|
1821
|
+
*
|
|
1822
|
+
* @param p - True distribution
|
|
1823
|
+
* @param q - Approximate distribution
|
|
1824
|
+
* @returns KL divergence (non-negative, 0 = identical)
|
|
1825
|
+
*/
|
|
1826
|
+
declare function klDivergence(p: number[], q: number[]): number;
|
|
1827
|
+
/**
|
|
1828
|
+
* Calculate Jensen-Shannon divergence (symmetric KL variant)
|
|
1829
|
+
* JSD(P, Q) = 0.5 * D_KL(P || M) + 0.5 * D_KL(Q || M) where M = 0.5(P + Q)
|
|
1830
|
+
*
|
|
1831
|
+
* @param p - First distribution
|
|
1832
|
+
* @param q - Second distribution
|
|
1833
|
+
* @returns JS divergence in [0, 1]
|
|
1834
|
+
*/
|
|
1835
|
+
declare function jsDivergence(p: number[], q: number[]): number;
|
|
1836
|
+
/**
|
|
1837
|
+
* Normalize an array to sum to 1 (probability distribution)
|
|
1838
|
+
*/
|
|
1839
|
+
declare function normalize(values: number[]): number[];
|
|
1840
|
+
/**
|
|
1841
|
+
* Calculate cosine similarity between two vectors
|
|
1842
|
+
*/
|
|
1843
|
+
declare function cosineSimilarity(a: number[], b: number[]): number;
|
|
1844
|
+
|
|
1845
|
+
/**
|
|
1846
|
+
* L0 Automatic Isomorphism Derivation
|
|
1847
|
+
*
|
|
1848
|
+
* Automatically derives isomorphisms between compatible types
|
|
1849
|
+
* using structural analysis and field mapping.
|
|
1850
|
+
*
|
|
1851
|
+
* @license BUSL-1.1
|
|
1852
|
+
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
1853
|
+
* @module core/L0/derivation
|
|
1854
|
+
*/
|
|
1855
|
+
|
|
1856
|
+
/**
|
|
1857
|
+
* Type shape descriptor for structural analysis
|
|
1858
|
+
*/
|
|
1859
|
+
interface TypeShape {
|
|
1860
|
+
/** Type kind (object, array, primitive, etc.) */
|
|
1861
|
+
kind: "object" | "array" | "primitive" | "null" | "undefined";
|
|
1862
|
+
/** For objects: map of field name to TypeShape */
|
|
1863
|
+
fields?: Record<string, TypeShape>;
|
|
1864
|
+
/** For arrays: element type shape */
|
|
1865
|
+
elementType?: TypeShape;
|
|
1866
|
+
/** For primitives: the primitive type */
|
|
1867
|
+
primitiveType?: "string" | "number" | "boolean" | "bigint" | "symbol";
|
|
1868
|
+
/** Whether the field is optional */
|
|
1869
|
+
optional?: boolean;
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* Extract the structural shape of a value at runtime
|
|
1873
|
+
*
|
|
1874
|
+
* @param value - Value to analyze
|
|
1875
|
+
* @returns TypeShape descriptor
|
|
1876
|
+
*/
|
|
1877
|
+
declare function extractShape(value: unknown): TypeShape;
|
|
1878
|
+
/**
|
|
1879
|
+
* Calculate similarity between two type shapes (Jaccard-like)
|
|
1880
|
+
*
|
|
1881
|
+
* @param a - First type shape
|
|
1882
|
+
* @param b - Second type shape
|
|
1883
|
+
* @returns Similarity score (0-1)
|
|
1884
|
+
*/
|
|
1885
|
+
declare function shapeSimilarity(a: TypeShape, b: TypeShape): number;
|
|
1886
|
+
/**
|
|
1887
|
+
* A mapping between fields in source and target types
|
|
1888
|
+
*/
|
|
1889
|
+
interface FieldMapping {
|
|
1890
|
+
/** Source field name */
|
|
1891
|
+
source: string;
|
|
1892
|
+
/** Target field name */
|
|
1893
|
+
target: string;
|
|
1894
|
+
/** Confidence of the mapping (0-1) */
|
|
1895
|
+
confidence: number;
|
|
1896
|
+
/** Transform function if types differ */
|
|
1897
|
+
transform?: Morphism<unknown, unknown>;
|
|
1898
|
+
}
|
|
1899
|
+
/**
|
|
1900
|
+
* Derive field mappings between two object shapes
|
|
1901
|
+
*
|
|
1902
|
+
* @param source - Source type shape
|
|
1903
|
+
* @param target - Target type shape
|
|
1904
|
+
* @returns Array of field mappings
|
|
1905
|
+
*/
|
|
1906
|
+
declare function deriveFieldMappings(source: TypeShape, target: TypeShape): FieldMapping[];
|
|
1907
|
+
/**
|
|
1908
|
+
* Result of automatic isomorphism derivation
|
|
1909
|
+
*/
|
|
1910
|
+
interface DerivedIso<A, B> extends Iso<A, B> {
|
|
1911
|
+
/** Field mappings used */
|
|
1912
|
+
fieldMappings: FieldMapping[];
|
|
1913
|
+
/** Overall confidence score */
|
|
1914
|
+
confidence: number;
|
|
1915
|
+
}
|
|
1916
|
+
/**
|
|
1917
|
+
* Options for isomorphism derivation
|
|
1918
|
+
*/
|
|
1919
|
+
interface DerivationOptions {
|
|
1920
|
+
/** Minimum confidence threshold (default: 0.5) */
|
|
1921
|
+
minConfidence?: number;
|
|
1922
|
+
/** Whether to include partial mappings (default: true) */
|
|
1923
|
+
includePartial?: boolean;
|
|
1924
|
+
/** Custom field transforms */
|
|
1925
|
+
customTransforms?: Record<string, Morphism<unknown, unknown>>;
|
|
1926
|
+
}
|
|
1927
|
+
/**
|
|
1928
|
+
* Automatically derive an isomorphism between two types based on structure
|
|
1929
|
+
*
|
|
1930
|
+
* @param sampleA - Sample value of type A
|
|
1931
|
+
* @param sampleB - Sample value of type B
|
|
1932
|
+
* @param options - Derivation options
|
|
1933
|
+
* @returns Derived isomorphism or null if not derivable
|
|
1934
|
+
*/
|
|
1935
|
+
declare function deriveIsomorphism<A extends object, B extends object>(sampleA: A, sampleB: B, options?: DerivationOptions): DerivedIso<A, B> | null;
|
|
1936
|
+
/**
|
|
1937
|
+
* Verify an isomorphism by testing round-trip on sample values
|
|
1938
|
+
*
|
|
1939
|
+
* @param iso - Isomorphism to verify
|
|
1940
|
+
* @param samples - Sample values to test
|
|
1941
|
+
* @returns True if all round-trips match
|
|
1942
|
+
*/
|
|
1943
|
+
declare function verifyIsomorphism<A, B>(iso: Iso<A, B>, samples: A[]): boolean;
|
|
1944
|
+
/**
|
|
1945
|
+
* Check if two types are structurally compatible for isomorphism
|
|
1946
|
+
*
|
|
1947
|
+
* @param shapeA - Source type shape
|
|
1948
|
+
* @param shapeB - Target type shape
|
|
1949
|
+
* @returns Compatibility score (0-1)
|
|
1950
|
+
*/
|
|
1951
|
+
declare function checkCompatibility(shapeA: TypeShape, shapeB: TypeShape): number;
|
|
1952
|
+
/**
|
|
1953
|
+
* Check if a type can be embedded into another (one-way mapping)
|
|
1954
|
+
*
|
|
1955
|
+
* @param source - Source type shape
|
|
1956
|
+
* @param target - Target type shape
|
|
1957
|
+
* @returns True if source can be fully embedded in target
|
|
1958
|
+
*/
|
|
1959
|
+
declare function canEmbed(source: TypeShape, target: TypeShape): boolean;
|
|
1960
|
+
|
|
2254
1961
|
/**
|
|
2255
|
-
*
|
|
1962
|
+
* L0 Sematon — The Smallest Meaning-Bearing Unit
|
|
2256
1963
|
*
|
|
2257
|
-
*
|
|
2258
|
-
*
|
|
1964
|
+
* The sematon is the atomic unit of operational meaning in Terminals OS.
|
|
1965
|
+
* It carries a typed payload, convergence witness, p-adic address,
|
|
1966
|
+
* information-theoretic metrics, and a constructor flag that guarantees
|
|
1967
|
+
* the Deutsch-Marletto invariant: after transforming an input, the
|
|
1968
|
+
* sematon retains the ability to transform again.
|
|
1969
|
+
*
|
|
1970
|
+
* The sematon unifies Signal<T>, ContextNode, FractalSnapshot,
|
|
1971
|
+
* ConvergenceWitness, and CombinatorEvent into a single formal type
|
|
1972
|
+
* at the L0 foundation layer.
|
|
1973
|
+
*
|
|
1974
|
+
* Core Engine Primitive.
|
|
1975
|
+
*
|
|
1976
|
+
* @license BUSL-1.1
|
|
1977
|
+
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
1978
|
+
* @module core/L0/sematon
|
|
2259
1979
|
*/
|
|
2260
|
-
declare function conditionalEntropy(jointProbabilities: number[][]): number;
|
|
2261
1980
|
/**
|
|
2262
|
-
*
|
|
2263
|
-
*
|
|
2264
|
-
*
|
|
2265
|
-
* @param pX - Marginal probability of X
|
|
2266
|
-
* @param pY - Marginal probability of Y
|
|
2267
|
-
* @param pXY - Joint probability P(X, Y) as 2D array
|
|
2268
|
-
* @returns Mutual information in bits
|
|
1981
|
+
* Payload kind classification for sematons.
|
|
1982
|
+
* Determines how the payload is interpreted across layers.
|
|
2269
1983
|
*/
|
|
2270
|
-
|
|
1984
|
+
type SematonKind = "signal" | "context" | "fractal" | "witness" | "combinator" | "interaction" | "custom";
|
|
2271
1985
|
/**
|
|
2272
|
-
*
|
|
1986
|
+
* Convergence witness snapshot embedded in a sematon.
|
|
1987
|
+
* Minimal subset of ConvergenceWitness for portability.
|
|
2273
1988
|
*/
|
|
2274
|
-
interface
|
|
2275
|
-
/**
|
|
2276
|
-
|
|
2277
|
-
/**
|
|
2278
|
-
|
|
2279
|
-
/**
|
|
2280
|
-
|
|
2281
|
-
/**
|
|
2282
|
-
|
|
2283
|
-
/** Whether the transformation is lossless */
|
|
2284
|
-
lossless: boolean;
|
|
1989
|
+
interface SematonWitness {
|
|
1990
|
+
/** Kuramoto order parameter R in [0, 1] */
|
|
1991
|
+
R: number;
|
|
1992
|
+
/** Shannon entropy of activation distribution */
|
|
1993
|
+
activationEntropy: number;
|
|
1994
|
+
/** Whether convergence criteria are met */
|
|
1995
|
+
converged: boolean;
|
|
1996
|
+
/** Step at which this witness was taken */
|
|
1997
|
+
step: number;
|
|
2285
1998
|
}
|
|
2286
1999
|
/**
|
|
2287
|
-
*
|
|
2288
|
-
* Uses hash-based sampling for large datasets.
|
|
2000
|
+
* The Sematon — smallest meaning-bearing unit with operational consequence.
|
|
2289
2001
|
*
|
|
2290
|
-
*
|
|
2291
|
-
*
|
|
2292
|
-
*
|
|
2293
|
-
*
|
|
2002
|
+
* Generic over T (the payload type):
|
|
2003
|
+
* T = Signal payload at signal kind
|
|
2004
|
+
* T = ContextNode metadata at context kind
|
|
2005
|
+
* T = FractalSnapshot at fractal kind
|
|
2006
|
+
* T = arbitrary at custom kind
|
|
2294
2007
|
*/
|
|
2295
|
-
|
|
2008
|
+
interface Sematon<T = unknown> {
|
|
2009
|
+
/** Unique identifier */
|
|
2010
|
+
readonly id: string;
|
|
2011
|
+
/** Payload kind classification */
|
|
2012
|
+
readonly kind: SematonKind;
|
|
2013
|
+
/** The meaning-bearing payload */
|
|
2014
|
+
readonly payload: T;
|
|
2015
|
+
/** Convergence witness at creation time */
|
|
2016
|
+
readonly witness: SematonWitness;
|
|
2017
|
+
/** p-adic address for hierarchical locality */
|
|
2018
|
+
readonly padicAddress: string;
|
|
2019
|
+
/** Shannon entropy of payload (bits) */
|
|
2020
|
+
readonly entropy: number;
|
|
2021
|
+
/** Semantic density (bits per token) */
|
|
2022
|
+
readonly density: number;
|
|
2023
|
+
/** The resistance to constructive transformation: H / (ρ * R) */
|
|
2024
|
+
readonly impedance: number;
|
|
2025
|
+
/** Deterministic content hash (FNV-1a) */
|
|
2026
|
+
readonly shapeHash: string;
|
|
2027
|
+
/**
|
|
2028
|
+
* Constructor flag: can this sematon participate in further transformations?
|
|
2029
|
+
* True iff: witness has converged AND entropy is finite AND payload is non-empty.
|
|
2030
|
+
* This is the Deutsch-Marletto invariant.
|
|
2031
|
+
*/
|
|
2032
|
+
readonly constructive: boolean;
|
|
2033
|
+
/** Creation timestamp */
|
|
2034
|
+
readonly createdAt: number;
|
|
2035
|
+
/** Source layer or surface that produced this sematon */
|
|
2036
|
+
readonly source: string;
|
|
2037
|
+
}
|
|
2296
2038
|
/**
|
|
2297
|
-
*
|
|
2298
|
-
*
|
|
2039
|
+
* Folded (serializable) representation of a Sematon.
|
|
2040
|
+
* Suitable for JSON serialization, mesh relay, or persistence.
|
|
2299
2041
|
*/
|
|
2300
|
-
interface
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2042
|
+
interface FoldedSematon {
|
|
2043
|
+
id: string;
|
|
2044
|
+
kind: SematonKind;
|
|
2045
|
+
payload: string;
|
|
2046
|
+
witness: SematonWitness;
|
|
2047
|
+
padicAddress: string;
|
|
2048
|
+
entropy: number;
|
|
2306
2049
|
density: number;
|
|
2307
|
-
|
|
2308
|
-
|
|
2050
|
+
impedance: number;
|
|
2051
|
+
shapeHash: string;
|
|
2052
|
+
constructive: boolean;
|
|
2053
|
+
createdAt: number;
|
|
2054
|
+
source: string;
|
|
2055
|
+
}
|
|
2056
|
+
interface SematonConfig<T> {
|
|
2057
|
+
kind: SematonKind;
|
|
2058
|
+
payload: T;
|
|
2059
|
+
witness: SematonWitness;
|
|
2060
|
+
padicAddress?: string;
|
|
2061
|
+
source?: string;
|
|
2309
2062
|
}
|
|
2310
2063
|
/**
|
|
2311
|
-
*
|
|
2312
|
-
*
|
|
2313
|
-
* @param tokens - Array of tokens (strings, symbols, etc.)
|
|
2314
|
-
* @param baselineTokensPerBit - Baseline tokens per bit of information (default: 2)
|
|
2315
|
-
* @returns Semantic density metrics
|
|
2064
|
+
* Create a new Sematon from configuration.
|
|
2316
2065
|
*/
|
|
2317
|
-
declare function
|
|
2066
|
+
declare function createSematon<T>(config: SematonConfig<T>): Sematon<T>;
|
|
2318
2067
|
/**
|
|
2319
|
-
*
|
|
2320
|
-
* Lower complexity = more compressible = more structured.
|
|
2321
|
-
*
|
|
2322
|
-
* @param data - String representation of data
|
|
2323
|
-
* @returns Estimated complexity as compression ratio
|
|
2068
|
+
* Get the Shannon entropy of a sematon's payload.
|
|
2324
2069
|
*/
|
|
2325
|
-
declare function
|
|
2070
|
+
declare function sematonEntropy<T>(sematon: Sematon<T>): number;
|
|
2326
2071
|
/**
|
|
2327
|
-
*
|
|
2328
|
-
* Measures how much P differs from Q.
|
|
2329
|
-
*
|
|
2330
|
-
* @param p - True distribution
|
|
2331
|
-
* @param q - Approximate distribution
|
|
2332
|
-
* @returns KL divergence (non-negative, 0 = identical)
|
|
2072
|
+
* Get the semantic density of a sematon.
|
|
2333
2073
|
*/
|
|
2334
|
-
declare function
|
|
2074
|
+
declare function sematonDensity<T>(sematon: Sematon<T>): number;
|
|
2335
2075
|
/**
|
|
2336
|
-
*
|
|
2337
|
-
*
|
|
2076
|
+
* Check if a sematon can participate in further transformations.
|
|
2077
|
+
* This is the Deutsch-Marletto constructor invariant.
|
|
2078
|
+
*/
|
|
2079
|
+
declare function isRealizable<T>(sematon: Sematon<T>): boolean;
|
|
2080
|
+
/**
|
|
2081
|
+
* Compute distance between two sematons using payload cosine similarity
|
|
2082
|
+
* weighted by witness R proximity.
|
|
2338
2083
|
*
|
|
2339
|
-
*
|
|
2340
|
-
* @param q - Second distribution
|
|
2341
|
-
* @returns JS divergence in [0, 1]
|
|
2084
|
+
* Distance in [0, 1] where 0 = identical, 1 = maximally different.
|
|
2342
2085
|
*/
|
|
2343
|
-
declare function
|
|
2086
|
+
declare function sematonDistance<T>(a: Sematon<T>, b: Sematon<T>): number;
|
|
2344
2087
|
/**
|
|
2345
|
-
*
|
|
2088
|
+
* Fold a Sematon into a JSON-serializable representation.
|
|
2089
|
+
* HVM γ (construct) — compress for handoff, persistence, or relay.
|
|
2346
2090
|
*/
|
|
2347
|
-
declare function
|
|
2091
|
+
declare function foldSematon<T>(sematon: Sematon<T>): FoldedSematon;
|
|
2348
2092
|
/**
|
|
2349
|
-
*
|
|
2093
|
+
* Unfold a serialized representation back into a Sematon.
|
|
2094
|
+
* HVM δ (duplicate) — expand from handoff, persistence, or relay.
|
|
2350
2095
|
*/
|
|
2351
|
-
declare function
|
|
2096
|
+
declare function unfoldSematon<T>(folded: FoldedSematon): Sematon<T>;
|
|
2352
2097
|
|
|
2353
2098
|
/**
|
|
2354
|
-
* L0
|
|
2099
|
+
* L0 Realizability Trace — Constructor Proof Runtime
|
|
2355
2100
|
*
|
|
2356
|
-
*
|
|
2357
|
-
*
|
|
2101
|
+
* A RealizabilityTrace is an ordered sequence of RealizabilitySteps.
|
|
2102
|
+
* Each step records: input Sematon(s), output Sematon(s), a ConvergenceWitness
|
|
2103
|
+
* snapshot, and information gain.
|
|
2104
|
+
*
|
|
2105
|
+
* verifyTrace() checks three constructor invariants:
|
|
2106
|
+
* 1. Each input was realizable (constructive flag true)
|
|
2107
|
+
* 2. Each witness converged (R above threshold)
|
|
2108
|
+
* 3. Information is non-decreasing across steps
|
|
2109
|
+
*
|
|
2110
|
+
* This is the Deutsch-Marletto constructor invariant made executable:
|
|
2111
|
+
* after transforming inputs, the system retains the ability to transform again.
|
|
2358
2112
|
*
|
|
2359
2113
|
* @license BUSL-1.1
|
|
2360
2114
|
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
2361
|
-
* @module core/L0/
|
|
2115
|
+
* @module core/L0/realizability
|
|
2362
2116
|
*/
|
|
2363
2117
|
|
|
2118
|
+
interface RealizabilityStep {
|
|
2119
|
+
/** Step index in the trace */
|
|
2120
|
+
index: number;
|
|
2121
|
+
/** Input sematons consumed by this step */
|
|
2122
|
+
inputs: Sematon[];
|
|
2123
|
+
/** Output sematons produced by this step */
|
|
2124
|
+
outputs: Sematon[];
|
|
2125
|
+
/** Convergence witness at this step */
|
|
2126
|
+
witness: SematonWitness;
|
|
2127
|
+
/** Total information content of outputs (bits) */
|
|
2128
|
+
informationGain: number;
|
|
2129
|
+
/** Timestamp */
|
|
2130
|
+
timestamp: number;
|
|
2131
|
+
}
|
|
2132
|
+
interface RealizabilityTrace {
|
|
2133
|
+
/** Unique trace identifier */
|
|
2134
|
+
id: string;
|
|
2135
|
+
/** Ordered sequence of steps */
|
|
2136
|
+
steps: RealizabilityStep[];
|
|
2137
|
+
/** Whether the trace has been verified */
|
|
2138
|
+
verified: boolean;
|
|
2139
|
+
/** Total information gain across all steps */
|
|
2140
|
+
totalInfoGain: number;
|
|
2141
|
+
/** Count of constructive (realizable) steps */
|
|
2142
|
+
constructiveSteps: number;
|
|
2143
|
+
/** Creation timestamp */
|
|
2144
|
+
createdAt: number;
|
|
2145
|
+
}
|
|
2146
|
+
interface VerificationSuccess {
|
|
2147
|
+
valid: true;
|
|
2148
|
+
totalInfoGain: number;
|
|
2149
|
+
constructiveSteps: number;
|
|
2150
|
+
}
|
|
2151
|
+
interface VerificationFailure {
|
|
2152
|
+
valid: false;
|
|
2153
|
+
failureStep: number;
|
|
2154
|
+
reason: string;
|
|
2155
|
+
}
|
|
2156
|
+
type VerificationResult = VerificationSuccess | VerificationFailure;
|
|
2364
2157
|
/**
|
|
2365
|
-
*
|
|
2158
|
+
* Create a single realizability step.
|
|
2159
|
+
* Computes informationGain as the sum of output sematon entropies.
|
|
2366
2160
|
*/
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
elementType?: TypeShape;
|
|
2374
|
-
/** For primitives: the primitive type */
|
|
2375
|
-
primitiveType?: "string" | "number" | "boolean" | "bigint" | "symbol";
|
|
2376
|
-
/** Whether the field is optional */
|
|
2377
|
-
optional?: boolean;
|
|
2378
|
-
}
|
|
2161
|
+
declare function createRealizabilityStep(index: number, inputs: Sematon[], outputs: Sematon[], witness: SematonWitness): RealizabilityStep;
|
|
2162
|
+
/**
|
|
2163
|
+
* Construct a RealizabilityTrace from an ordered sequence of steps.
|
|
2164
|
+
* Computes totalInfoGain and constructiveSteps.
|
|
2165
|
+
*/
|
|
2166
|
+
declare function traceRealizability(steps: RealizabilityStep[]): RealizabilityTrace;
|
|
2379
2167
|
/**
|
|
2380
|
-
*
|
|
2168
|
+
* Verify a realizability trace against three constructor invariants:
|
|
2169
|
+
* 1. Each step's inputs must all be realizable
|
|
2170
|
+
* 2. Each step's witness must have converged
|
|
2171
|
+
* 3. Information is non-decreasing across steps
|
|
2381
2172
|
*
|
|
2382
|
-
*
|
|
2383
|
-
* @returns TypeShape descriptor
|
|
2173
|
+
* Returns VerificationSuccess or VerificationFailure with step index and reason.
|
|
2384
2174
|
*/
|
|
2385
|
-
declare function
|
|
2175
|
+
declare function verifyTrace(trace: RealizabilityTrace): VerificationResult;
|
|
2386
2176
|
/**
|
|
2387
|
-
*
|
|
2388
|
-
*
|
|
2389
|
-
* @param a - First type shape
|
|
2390
|
-
* @param b - Second type shape
|
|
2391
|
-
* @returns Similarity score (0-1)
|
|
2177
|
+
* Fold a RealizabilityTrace into a JSON string.
|
|
2178
|
+
* Sematons are folded via foldSematon first for portable serialization.
|
|
2392
2179
|
*/
|
|
2393
|
-
declare function
|
|
2180
|
+
declare function foldTrace(trace: RealizabilityTrace): string;
|
|
2394
2181
|
/**
|
|
2395
|
-
*
|
|
2182
|
+
* Unfold a JSON string back into a RealizabilityTrace.
|
|
2183
|
+
* Sematons are unfolded via unfoldSematon.
|
|
2396
2184
|
*/
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
source: string;
|
|
2400
|
-
/** Target field name */
|
|
2401
|
-
target: string;
|
|
2402
|
-
/** Confidence of the mapping (0-1) */
|
|
2403
|
-
confidence: number;
|
|
2404
|
-
/** Transform function if types differ */
|
|
2405
|
-
transform?: Morphism<unknown, unknown>;
|
|
2406
|
-
}
|
|
2185
|
+
declare function unfoldTrace(json: string): RealizabilityTrace;
|
|
2186
|
+
|
|
2407
2187
|
/**
|
|
2408
|
-
*
|
|
2188
|
+
* L0 Foundation Layer
|
|
2409
2189
|
*
|
|
2410
|
-
*
|
|
2411
|
-
*
|
|
2412
|
-
*
|
|
2190
|
+
* Provides categorical foundations and information-theoretic primitives
|
|
2191
|
+
* for cross-layer mappings in the AXON architecture.
|
|
2192
|
+
*
|
|
2193
|
+
* @module core/L0
|
|
2413
2194
|
*/
|
|
2414
|
-
|
|
2195
|
+
|
|
2196
|
+
type index_AsyncIso<A, B> = AsyncIso<A, B>;
|
|
2197
|
+
type index_AsyncMorphism<A, B> = AsyncMorphism<A, B>;
|
|
2198
|
+
type index_Category<Obj, Hom> = Category<Obj, Hom>;
|
|
2199
|
+
type index_Coproduct<A, B> = Coproduct<A, B>;
|
|
2200
|
+
type index_DerivationOptions = DerivationOptions;
|
|
2201
|
+
type index_DerivedIso<A, B> = DerivedIso<A, B>;
|
|
2202
|
+
type index_Embed<A, B> = Embed<A, B>;
|
|
2203
|
+
type index_FieldMapping = FieldMapping;
|
|
2204
|
+
type index_FoldedSematon = FoldedSematon;
|
|
2205
|
+
type index_Functor<F> = Functor<F>;
|
|
2206
|
+
type index_InformationPreservation = InformationPreservation;
|
|
2207
|
+
type index_Iso<A, B> = Iso<A, B>;
|
|
2208
|
+
type index_IsoMeta = IsoMeta;
|
|
2209
|
+
declare const index_LAYERS: typeof LAYERS;
|
|
2210
|
+
type index_LayerBridge<From extends LayerId, To extends LayerId, A, B> = LayerBridge<From, To, A, B>;
|
|
2211
|
+
type index_LayerId = LayerId;
|
|
2212
|
+
type index_LayerMeta = LayerMeta;
|
|
2213
|
+
type index_Morphism<A, B> = Morphism<A, B>;
|
|
2214
|
+
type index_NaturalTransformation<F, G> = NaturalTransformation<F, G>;
|
|
2215
|
+
type index_Product<A, B> = Product<A, B>;
|
|
2216
|
+
type index_Proof<P> = Proof<P>;
|
|
2217
|
+
type index_RealizabilityStep = RealizabilityStep;
|
|
2218
|
+
type index_RealizabilityTrace = RealizabilityTrace;
|
|
2219
|
+
type index_SemanticDensity = SemanticDensity;
|
|
2220
|
+
type index_Sematon<T = unknown> = Sematon<T>;
|
|
2221
|
+
type index_SematonConfig<T> = SematonConfig<T>;
|
|
2222
|
+
type index_SematonKind = SematonKind;
|
|
2223
|
+
type index_SematonWitness = SematonWitness;
|
|
2224
|
+
type index_TypeShape = TypeShape;
|
|
2225
|
+
declare const index_VALID_TRANSITIONS: typeof VALID_TRANSITIONS;
|
|
2226
|
+
type index_VerificationFailure = VerificationFailure;
|
|
2227
|
+
type index_VerificationResult = VerificationResult;
|
|
2228
|
+
type index_VerificationSuccess = VerificationSuccess;
|
|
2229
|
+
type index_Verified<T, P> = Verified<T, P>;
|
|
2230
|
+
declare const index_calculateSemanticDensity: typeof calculateSemanticDensity;
|
|
2231
|
+
declare const index_canEmbed: typeof canEmbed;
|
|
2232
|
+
declare const index_checkCompatibility: typeof checkCompatibility;
|
|
2233
|
+
declare const index_compose: typeof compose;
|
|
2234
|
+
declare const index_composeAsync: typeof composeAsync;
|
|
2235
|
+
declare const index_composeIso: typeof composeIso;
|
|
2236
|
+
declare const index_conditionalEntropy: typeof conditionalEntropy;
|
|
2237
|
+
declare const index_cosineSimilarity: typeof cosineSimilarity;
|
|
2238
|
+
declare const index_createBridge: typeof createBridge;
|
|
2239
|
+
declare const index_createRealizabilityStep: typeof createRealizabilityStep;
|
|
2240
|
+
declare const index_createSematon: typeof createSematon;
|
|
2241
|
+
declare const index_deriveFieldMappings: typeof deriveFieldMappings;
|
|
2242
|
+
declare const index_deriveIsomorphism: typeof deriveIsomorphism;
|
|
2243
|
+
declare const index_entropy: typeof entropy;
|
|
2244
|
+
declare const index_estimateComplexity: typeof estimateComplexity;
|
|
2245
|
+
declare const index_extractShape: typeof extractShape;
|
|
2246
|
+
declare const index_fold: typeof fold;
|
|
2247
|
+
declare const index_foldSematon: typeof foldSematon;
|
|
2248
|
+
declare const index_foldTrace: typeof foldTrace;
|
|
2249
|
+
declare const index_identity: typeof identity;
|
|
2250
|
+
declare const index_identityIso: typeof identityIso;
|
|
2251
|
+
declare const index_invertIso: typeof invertIso;
|
|
2252
|
+
declare const index_isRealizable: typeof isRealizable;
|
|
2253
|
+
declare const index_isValidTransition: typeof isValidTransition;
|
|
2254
|
+
declare const index_jointEntropy: typeof jointEntropy;
|
|
2255
|
+
declare const index_jsDivergence: typeof jsDivergence;
|
|
2256
|
+
declare const index_klDivergence: typeof klDivergence;
|
|
2257
|
+
declare const index_left: typeof left;
|
|
2258
|
+
declare const index_measurePreservation: typeof measurePreservation;
|
|
2259
|
+
declare const index_mutualInformation: typeof mutualInformation;
|
|
2260
|
+
declare const index_normalize: typeof normalize;
|
|
2261
|
+
declare const index_right: typeof right;
|
|
2262
|
+
declare const index_sematonDensity: typeof sematonDensity;
|
|
2263
|
+
declare const index_sematonDistance: typeof sematonDistance;
|
|
2264
|
+
declare const index_sematonEntropy: typeof sematonEntropy;
|
|
2265
|
+
declare const index_shapeSimilarity: typeof shapeSimilarity;
|
|
2266
|
+
declare const index_traceRealizability: typeof traceRealizability;
|
|
2267
|
+
declare const index_unfoldSematon: typeof unfoldSematon;
|
|
2268
|
+
declare const index_unfoldTrace: typeof unfoldTrace;
|
|
2269
|
+
declare const index_verifyIsomorphism: typeof verifyIsomorphism;
|
|
2270
|
+
declare const index_verifyTrace: typeof verifyTrace;
|
|
2271
|
+
declare namespace index {
|
|
2272
|
+
export { type index_AsyncIso as AsyncIso, type index_AsyncMorphism as AsyncMorphism, type index_Category as Category, type index_Coproduct as Coproduct, type index_DerivationOptions as DerivationOptions, type index_DerivedIso as DerivedIso, type index_Embed as Embed, type index_FieldMapping as FieldMapping, type index_FoldedSematon as FoldedSematon, type index_Functor as Functor, type index_InformationPreservation as InformationPreservation, type index_Iso as Iso, type index_IsoMeta as IsoMeta, index_LAYERS as LAYERS, type index_LayerBridge as LayerBridge, type index_LayerId as LayerId, type index_LayerMeta as LayerMeta, type index_Morphism as Morphism, type index_NaturalTransformation as NaturalTransformation, type index_Product as Product, type index_Proof as Proof, type index_RealizabilityStep as RealizabilityStep, type index_RealizabilityTrace as RealizabilityTrace, type index_SemanticDensity as SemanticDensity, type index_Sematon as Sematon, type index_SematonConfig as SematonConfig, type index_SematonKind as SematonKind, type index_SematonWitness as SematonWitness, type index_TypeShape as TypeShape, index_VALID_TRANSITIONS as VALID_TRANSITIONS, type index_VerificationFailure as VerificationFailure, type index_VerificationResult as VerificationResult, type index_VerificationSuccess as VerificationSuccess, type index_Verified as Verified, index_calculateSemanticDensity as calculateSemanticDensity, index_canEmbed as canEmbed, index_checkCompatibility as checkCompatibility, index_compose as compose, index_composeAsync as composeAsync, index_composeIso as composeIso, index_conditionalEntropy as conditionalEntropy, index_cosineSimilarity as cosineSimilarity, index_createBridge as createBridge, index_createRealizabilityStep as createRealizabilityStep, index_createSematon as createSematon, index_deriveFieldMappings as deriveFieldMappings, index_deriveIsomorphism as deriveIsomorphism, index_entropy as entropy, index_estimateComplexity as estimateComplexity, index_extractShape as extractShape, index_fold as fold, index_foldSematon as foldSematon, index_foldTrace as foldTrace, index_identity as identity, index_identityIso as identityIso, index_invertIso as invertIso, index_isRealizable as isRealizable, index_isValidTransition as isValidTransition, index_jointEntropy as jointEntropy, index_jsDivergence as jsDivergence, index_klDivergence as klDivergence, index_left as left, index_measurePreservation as measurePreservation, index_mutualInformation as mutualInformation, index_normalize as normalize, index_right as right, index_sematonDensity as sematonDensity, index_sematonDistance as sematonDistance, index_sematonEntropy as sematonEntropy, index_shapeSimilarity as shapeSimilarity, index_traceRealizability as traceRealizability, index_unfoldSematon as unfoldSematon, index_unfoldTrace as unfoldTrace, index_verifyIsomorphism as verifyIsomorphism, index_verifyTrace as verifyTrace };
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2415
2275
|
/**
|
|
2416
|
-
*
|
|
2276
|
+
* Action Algebra — Input-Agnostic Action Types
|
|
2277
|
+
*
|
|
2278
|
+
* All input surfaces (keyboard, gamepad, voice, touch) compile down to this algebra.
|
|
2279
|
+
* All executors interpret this algebra into effects.
|
|
2280
|
+
*
|
|
2281
|
+
* @module core/primitives/action
|
|
2417
2282
|
*/
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2283
|
+
|
|
2284
|
+
type NavigationTarget = {
|
|
2285
|
+
kind: "surface";
|
|
2286
|
+
surface: SurfaceId;
|
|
2287
|
+
} | {
|
|
2288
|
+
kind: "tab";
|
|
2289
|
+
tab: string;
|
|
2290
|
+
} | {
|
|
2291
|
+
kind: "route";
|
|
2292
|
+
path: string;
|
|
2293
|
+
params?: Record<string, string>;
|
|
2294
|
+
} | {
|
|
2295
|
+
kind: "focus";
|
|
2296
|
+
elementId: string;
|
|
2297
|
+
} | {
|
|
2298
|
+
kind: "relative";
|
|
2299
|
+
direction: "up" | "down" | "left" | "right";
|
|
2300
|
+
};
|
|
2301
|
+
type SkillRef = {
|
|
2302
|
+
kind: "slug";
|
|
2303
|
+
slug: string;
|
|
2304
|
+
} | {
|
|
2305
|
+
kind: "id";
|
|
2306
|
+
id: string;
|
|
2307
|
+
} | {
|
|
2308
|
+
kind: "command";
|
|
2309
|
+
commandId: string;
|
|
2310
|
+
};
|
|
2311
|
+
interface ComposeEdge {
|
|
2312
|
+
sourceId: string;
|
|
2313
|
+
targetId: string;
|
|
2314
|
+
port?: string;
|
|
2315
|
+
}
|
|
2316
|
+
type ObserveTarget = {
|
|
2317
|
+
kind: "metric";
|
|
2318
|
+
metricId: string;
|
|
2319
|
+
} | {
|
|
2320
|
+
kind: "panel";
|
|
2321
|
+
panelId: string;
|
|
2322
|
+
} | {
|
|
2323
|
+
kind: "surface";
|
|
2324
|
+
surface: SurfaceId;
|
|
2325
|
+
};
|
|
2326
|
+
interface DelegateAssignment {
|
|
2327
|
+
agentId: string;
|
|
2328
|
+
taskDescription: string;
|
|
2329
|
+
context?: Record<string, unknown>;
|
|
2330
|
+
}
|
|
2331
|
+
type Action = {
|
|
2332
|
+
verb: "navigate";
|
|
2333
|
+
target: NavigationTarget;
|
|
2334
|
+
} | {
|
|
2335
|
+
verb: "execute";
|
|
2336
|
+
skill: SkillRef;
|
|
2337
|
+
args?: Record<string, unknown>;
|
|
2338
|
+
} | {
|
|
2339
|
+
verb: "compose";
|
|
2340
|
+
edge: ComposeEdge;
|
|
2341
|
+
} | {
|
|
2342
|
+
verb: "observe";
|
|
2343
|
+
target: ObserveTarget;
|
|
2344
|
+
zoom?: number;
|
|
2345
|
+
} | {
|
|
2346
|
+
verb: "delegate";
|
|
2347
|
+
assignment: DelegateAssignment;
|
|
2348
|
+
} | {
|
|
2349
|
+
verb: "palette";
|
|
2350
|
+
query?: string;
|
|
2351
|
+
} | {
|
|
2352
|
+
verb: "cancel";
|
|
2353
|
+
} | {
|
|
2354
|
+
verb: "undo";
|
|
2355
|
+
} | {
|
|
2356
|
+
verb: "redo";
|
|
2357
|
+
} | {
|
|
2358
|
+
verb: "sequence";
|
|
2359
|
+
actions: Action[];
|
|
2360
|
+
};
|
|
2361
|
+
type InputSurface = "keyboard" | "gamepad" | "voice" | "touch" | "command_palette";
|
|
2362
|
+
interface ActionEvent {
|
|
2363
|
+
action: Action;
|
|
2364
|
+
source: InputSurface;
|
|
2365
|
+
timestamp: number;
|
|
2366
|
+
inputTrace?: string[];
|
|
2367
|
+
}
|
|
2368
|
+
interface ActionContext {
|
|
2369
|
+
activeSurface: SurfaceId;
|
|
2370
|
+
activeTab: string;
|
|
2371
|
+
selection: string[];
|
|
2372
|
+
isTextFocused: boolean;
|
|
2373
|
+
isModalOpen: boolean;
|
|
2374
|
+
}
|
|
2375
|
+
type ActionPredicate = (ctx: ActionContext) => boolean;
|
|
2376
|
+
interface KeyboardTrigger {
|
|
2377
|
+
type: "chord" | "key" | "sequence";
|
|
2378
|
+
keys: string[];
|
|
2379
|
+
timeout?: number;
|
|
2380
|
+
}
|
|
2381
|
+
type GamepadButton = "a" | "b" | "x" | "y" | "lb" | "rb" | "lt" | "rt" | "back" | "start" | "ls" | "rs" | "dpad_up" | "dpad_down" | "dpad_left" | "dpad_right";
|
|
2382
|
+
interface GamepadTrigger {
|
|
2383
|
+
type: "button" | "combo" | "axis";
|
|
2384
|
+
buttons?: GamepadButton[];
|
|
2385
|
+
sequence?: {
|
|
2386
|
+
button: GamepadButton;
|
|
2387
|
+
holdMs?: number;
|
|
2388
|
+
}[];
|
|
2389
|
+
axis?: {
|
|
2390
|
+
stick: "left" | "right";
|
|
2391
|
+
direction: "up" | "down" | "left" | "right";
|
|
2392
|
+
threshold?: number;
|
|
2393
|
+
};
|
|
2394
|
+
}
|
|
2395
|
+
interface VoiceTrigger {
|
|
2396
|
+
type: "intent";
|
|
2397
|
+
patterns: string[];
|
|
2398
|
+
confidenceThreshold?: number;
|
|
2399
|
+
}
|
|
2400
|
+
interface TouchTrigger {
|
|
2401
|
+
type: "gesture";
|
|
2402
|
+
gesture: "swipe_left" | "swipe_right" | "swipe_up" | "swipe_down" | "pinch_in" | "pinch_out" | "long_press" | "double_tap" | "three_finger_swipe";
|
|
2423
2403
|
}
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
customTransforms?: Record<string, Morphism<unknown, unknown>>;
|
|
2404
|
+
type InputTrigger = KeyboardTrigger | GamepadTrigger | VoiceTrigger | TouchTrigger;
|
|
2405
|
+
interface ActionBinding {
|
|
2406
|
+
id: string;
|
|
2407
|
+
action: Action;
|
|
2408
|
+
label: string;
|
|
2409
|
+
category: string;
|
|
2410
|
+
when: ActionPredicate;
|
|
2411
|
+
trigger: InputTrigger;
|
|
2412
|
+
surface: InputSurface;
|
|
2434
2413
|
}
|
|
2414
|
+
/** Sequence two actions (flattens nested sequences) */
|
|
2415
|
+
declare function seq(a: Action, b: Action): Action;
|
|
2416
|
+
/** Navigate then execute */
|
|
2417
|
+
declare function goAndRun(target: NavigationTarget, skill: SkillRef): Action;
|
|
2418
|
+
/** Delegate then observe */
|
|
2419
|
+
declare function delegateAndWatch(assignment: DelegateAssignment, metric: ObserveTarget): Action;
|
|
2420
|
+
|
|
2435
2421
|
/**
|
|
2436
|
-
*
|
|
2437
|
-
*
|
|
2438
|
-
* @param sampleA - Sample value of type A
|
|
2439
|
-
* @param sampleB - Sample value of type B
|
|
2440
|
-
* @param options - Derivation options
|
|
2441
|
-
* @returns Derived isomorphism or null if not derivable
|
|
2442
|
-
*/
|
|
2443
|
-
declare function deriveIsomorphism<A extends object, B extends object>(sampleA: A, sampleB: B, options?: DerivationOptions): DerivedIso<A, B> | null;
|
|
2444
|
-
/**
|
|
2445
|
-
* Verify an isomorphism by testing round-trip on sample values
|
|
2446
|
-
*
|
|
2447
|
-
* @param iso - Isomorphism to verify
|
|
2448
|
-
* @param samples - Sample values to test
|
|
2449
|
-
* @returns True if all round-trips match
|
|
2450
|
-
*/
|
|
2451
|
-
declare function verifyIsomorphism<A, B>(iso: Iso<A, B>, samples: A[]): boolean;
|
|
2452
|
-
/**
|
|
2453
|
-
* Check if two types are structurally compatible for isomorphism
|
|
2422
|
+
* ActionBus — Singleton event bus for the Action Algebra
|
|
2454
2423
|
*
|
|
2455
|
-
*
|
|
2456
|
-
*
|
|
2457
|
-
* @returns Compatibility score (0-1)
|
|
2458
|
-
*/
|
|
2459
|
-
declare function checkCompatibility(shapeA: TypeShape, shapeB: TypeShape): number;
|
|
2460
|
-
/**
|
|
2461
|
-
* Check if a type can be embedded into another (one-way mapping)
|
|
2424
|
+
* All input surfaces publish ActionEvents here.
|
|
2425
|
+
* The executor and any observers subscribe here.
|
|
2462
2426
|
*
|
|
2463
|
-
* @
|
|
2464
|
-
* @param target - Target type shape
|
|
2465
|
-
* @returns True if source can be fully embedded in target
|
|
2427
|
+
* @module core/primitives/action-bus
|
|
2466
2428
|
*/
|
|
2467
|
-
|
|
2429
|
+
|
|
2430
|
+
type ActionBusEvents = {
|
|
2431
|
+
"action:dispatched": ActionEvent;
|
|
2432
|
+
"action:executed": ActionEvent & {
|
|
2433
|
+
result: "success" | "error";
|
|
2434
|
+
error?: string;
|
|
2435
|
+
};
|
|
2436
|
+
"action:cancelled": {
|
|
2437
|
+
reason: string;
|
|
2438
|
+
timestamp: number;
|
|
2439
|
+
};
|
|
2440
|
+
"context:changed": ActionContext;
|
|
2441
|
+
};
|
|
2442
|
+
declare function getActionBus(): TypedEventBus<ActionBusEvents>;
|
|
2443
|
+
declare function dispatchAction(event: ActionEvent): void;
|
|
2444
|
+
declare function onAction(handler: (event: ActionEvent) => void): () => void;
|
|
2468
2445
|
|
|
2469
2446
|
/**
|
|
2470
|
-
*
|
|
2471
|
-
*
|
|
2472
|
-
* The sematon is the atomic unit of operational meaning in Terminals OS.
|
|
2473
|
-
* It carries a typed payload, convergence witness, p-adic address,
|
|
2474
|
-
* information-theoretic metrics, and a constructor flag that guarantees
|
|
2475
|
-
* the Deutsch-Marletto invariant: after transforming an input, the
|
|
2476
|
-
* sematon retains the ability to transform again.
|
|
2477
|
-
*
|
|
2478
|
-
* The sematon unifies Signal<T>, ContextNode, FractalSnapshot,
|
|
2479
|
-
* ConvergenceWitness, and CombinatorEvent into a single formal type
|
|
2480
|
-
* at the L0 foundation layer.
|
|
2447
|
+
* Mesh SDK — Event emission, subscription, and query
|
|
2481
2448
|
*
|
|
2482
|
-
*
|
|
2449
|
+
* Cross-layer communication via signals and the action bus.
|
|
2450
|
+
* Hides Interaction primitive internals, SDKMessage, AXON internals.
|
|
2483
2451
|
*
|
|
2484
|
-
* @license BUSL-1.1
|
|
2485
2452
|
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
2486
|
-
* @module
|
|
2487
|
-
*/
|
|
2488
|
-
/**
|
|
2489
|
-
* Payload kind classification for sematons.
|
|
2490
|
-
* Determines how the payload is interpreted across layers.
|
|
2491
|
-
*/
|
|
2492
|
-
type SematonKind = "signal" | "context" | "fractal" | "witness" | "combinator" | "interaction" | "custom";
|
|
2493
|
-
/**
|
|
2494
|
-
* Convergence witness snapshot embedded in a sematon.
|
|
2495
|
-
* Minimal subset of ConvergenceWitness for portability.
|
|
2496
|
-
*/
|
|
2497
|
-
interface SematonWitness {
|
|
2498
|
-
/** Kuramoto order parameter R in [0, 1] */
|
|
2499
|
-
R: number;
|
|
2500
|
-
/** Shannon entropy of activation distribution */
|
|
2501
|
-
activationEntropy: number;
|
|
2502
|
-
/** Whether convergence criteria are met */
|
|
2503
|
-
converged: boolean;
|
|
2504
|
-
/** Step at which this witness was taken */
|
|
2505
|
-
step: number;
|
|
2506
|
-
}
|
|
2507
|
-
/**
|
|
2508
|
-
* The Sematon — smallest meaning-bearing unit with operational consequence.
|
|
2509
|
-
*
|
|
2510
|
-
* Generic over T (the payload type):
|
|
2511
|
-
* T = Signal payload at signal kind
|
|
2512
|
-
* T = ContextNode metadata at context kind
|
|
2513
|
-
* T = FractalSnapshot at fractal kind
|
|
2514
|
-
* T = arbitrary at custom kind
|
|
2515
|
-
*/
|
|
2516
|
-
interface Sematon<T = unknown> {
|
|
2517
|
-
/** Unique identifier */
|
|
2518
|
-
readonly id: string;
|
|
2519
|
-
/** Payload kind classification */
|
|
2520
|
-
readonly kind: SematonKind;
|
|
2521
|
-
/** The meaning-bearing payload */
|
|
2522
|
-
readonly payload: T;
|
|
2523
|
-
/** Convergence witness at creation time */
|
|
2524
|
-
readonly witness: SematonWitness;
|
|
2525
|
-
/** p-adic address for hierarchical locality */
|
|
2526
|
-
readonly padicAddress: string;
|
|
2527
|
-
/** Shannon entropy of payload (bits) */
|
|
2528
|
-
readonly entropy: number;
|
|
2529
|
-
/** Semantic density (bits per token) */
|
|
2530
|
-
readonly density: number;
|
|
2531
|
-
/** The resistance to constructive transformation: H / (ρ * R) */
|
|
2532
|
-
readonly impedance: number;
|
|
2533
|
-
/** Deterministic content hash (FNV-1a) */
|
|
2534
|
-
readonly shapeHash: string;
|
|
2535
|
-
/**
|
|
2536
|
-
* Constructor flag: can this sematon participate in further transformations?
|
|
2537
|
-
* True iff: witness has converged AND entropy is finite AND payload is non-empty.
|
|
2538
|
-
* This is the Deutsch-Marletto invariant.
|
|
2539
|
-
*/
|
|
2540
|
-
readonly constructive: boolean;
|
|
2541
|
-
/** Creation timestamp */
|
|
2542
|
-
readonly createdAt: number;
|
|
2543
|
-
/** Source layer or surface that produced this sematon */
|
|
2544
|
-
readonly source: string;
|
|
2545
|
-
}
|
|
2546
|
-
/**
|
|
2547
|
-
* Folded (serializable) representation of a Sematon.
|
|
2548
|
-
* Suitable for JSON serialization, mesh relay, or persistence.
|
|
2453
|
+
* @module sdk/mesh
|
|
2549
2454
|
*/
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2455
|
+
|
|
2456
|
+
type mesh_Action = Action;
|
|
2457
|
+
type mesh_ActionBinding = ActionBinding;
|
|
2458
|
+
type mesh_ActionBusEvents = ActionBusEvents;
|
|
2459
|
+
type mesh_ActionContext = ActionContext;
|
|
2460
|
+
type mesh_ActionEvent = ActionEvent;
|
|
2461
|
+
type mesh_InputSurface = InputSurface;
|
|
2462
|
+
type mesh_Signal<T = unknown> = Signal<T>;
|
|
2463
|
+
type mesh_SignalBus = SignalBus;
|
|
2464
|
+
type mesh_SignalHandler<T = unknown> = SignalHandler<T>;
|
|
2465
|
+
type mesh_SignalType = SignalType;
|
|
2466
|
+
declare const mesh_createSignalBus: typeof createSignalBus;
|
|
2467
|
+
declare const mesh_delegateAndWatch: typeof delegateAndWatch;
|
|
2468
|
+
declare const mesh_dispatchAction: typeof dispatchAction;
|
|
2469
|
+
declare const mesh_emitSignal: typeof emitSignal;
|
|
2470
|
+
declare const mesh_getActionBus: typeof getActionBus;
|
|
2471
|
+
declare const mesh_getSignalBus: typeof getSignalBus;
|
|
2472
|
+
declare const mesh_goAndRun: typeof goAndRun;
|
|
2473
|
+
declare const mesh_onAction: typeof onAction;
|
|
2474
|
+
declare const mesh_seq: typeof seq;
|
|
2475
|
+
declare const mesh_subscribeToSignals: typeof subscribeToSignals;
|
|
2476
|
+
declare namespace mesh {
|
|
2477
|
+
export { type mesh_Action as Action, type mesh_ActionBinding as ActionBinding, type mesh_ActionBusEvents as ActionBusEvents, type mesh_ActionContext as ActionContext, type mesh_ActionEvent as ActionEvent, type mesh_InputSurface as InputSurface, type mesh_Signal as Signal, type mesh_SignalBus as SignalBus, type mesh_SignalHandler as SignalHandler, type mesh_SignalType as SignalType, mesh_createSignalBus as createSignalBus, mesh_delegateAndWatch as delegateAndWatch, mesh_dispatchAction as dispatchAction, mesh_emitSignal as emitSignal, mesh_getActionBus as getActionBus, mesh_getSignalBus as getSignalBus, mesh_goAndRun as goAndRun, mesh_onAction as onAction, mesh_seq as seq, mesh_subscribeToSignals as subscribeToSignals };
|
|
2570
2478
|
}
|
|
2571
|
-
/**
|
|
2572
|
-
* Create a new Sematon from configuration.
|
|
2573
|
-
*/
|
|
2574
|
-
declare function createSematon<T>(config: SematonConfig<T>): Sematon<T>;
|
|
2575
|
-
/**
|
|
2576
|
-
* Get the Shannon entropy of a sematon's payload.
|
|
2577
|
-
*/
|
|
2578
|
-
declare function sematonEntropy<T>(sematon: Sematon<T>): number;
|
|
2579
|
-
/**
|
|
2580
|
-
* Get the semantic density of a sematon.
|
|
2581
|
-
*/
|
|
2582
|
-
declare function sematonDensity<T>(sematon: Sematon<T>): number;
|
|
2583
|
-
/**
|
|
2584
|
-
* Check if a sematon can participate in further transformations.
|
|
2585
|
-
* This is the Deutsch-Marletto constructor invariant.
|
|
2586
|
-
*/
|
|
2587
|
-
declare function isRealizable<T>(sematon: Sematon<T>): boolean;
|
|
2588
|
-
/**
|
|
2589
|
-
* Compute distance between two sematons using payload cosine similarity
|
|
2590
|
-
* weighted by witness R proximity.
|
|
2591
|
-
*
|
|
2592
|
-
* Distance in [0, 1] where 0 = identical, 1 = maximally different.
|
|
2593
|
-
*/
|
|
2594
|
-
declare function sematonDistance<T>(a: Sematon<T>, b: Sematon<T>): number;
|
|
2595
|
-
/**
|
|
2596
|
-
* Fold a Sematon into a JSON-serializable representation.
|
|
2597
|
-
* HVM γ (construct) — compress for handoff, persistence, or relay.
|
|
2598
|
-
*/
|
|
2599
|
-
declare function foldSematon<T>(sematon: Sematon<T>): FoldedSematon;
|
|
2600
|
-
/**
|
|
2601
|
-
* Unfold a serialized representation back into a Sematon.
|
|
2602
|
-
* HVM δ (duplicate) — expand from handoff, persistence, or relay.
|
|
2603
|
-
*/
|
|
2604
|
-
declare function unfoldSematon<T>(folded: FoldedSematon): Sematon<T>;
|
|
2605
2479
|
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2480
|
+
type brain_CoherenceConfig = CoherenceConfig;
|
|
2481
|
+
type brain_CoherenceInput = CoherenceInput;
|
|
2482
|
+
type brain_CoherenceMetrics = CoherenceMetrics;
|
|
2483
|
+
type brain_CoherenceResult = CoherenceResult;
|
|
2484
|
+
type brain_KuramotoStepOptions = KuramotoStepOptions;
|
|
2485
|
+
type brain_OrderParameter = OrderParameter;
|
|
2486
|
+
declare const brain_calculateCoherence: typeof calculateCoherence;
|
|
2487
|
+
declare const brain_calculateCoherenceWithExplanations: typeof calculateCoherenceWithExplanations;
|
|
2488
|
+
declare const brain_getCoherenceSuggestions: typeof getCoherenceSuggestions;
|
|
2489
|
+
declare const brain_isCoherent: typeof isCoherent;
|
|
2490
|
+
declare const brain_kuramotoStep: typeof kuramotoStep;
|
|
2491
|
+
declare const brain_orderParameter: typeof orderParameter;
|
|
2492
|
+
declare const brain_phaseLockingValue: typeof phaseLockingValue;
|
|
2493
|
+
declare const brain_wrapTo2Pi: typeof wrapTo2Pi;
|
|
2494
|
+
declare const brain_wrapToPi: typeof wrapToPi;
|
|
2495
|
+
declare namespace brain {
|
|
2496
|
+
export { type brain_CoherenceConfig as CoherenceConfig, type brain_CoherenceInput as CoherenceInput, type brain_CoherenceMetrics as CoherenceMetrics, type brain_CoherenceResult as CoherenceResult, type brain_KuramotoStepOptions as KuramotoStepOptions, type brain_OrderParameter as OrderParameter, brain_calculateCoherence as calculateCoherence, brain_calculateCoherenceWithExplanations as calculateCoherenceWithExplanations, brain_getCoherenceSuggestions as getCoherenceSuggestions, brain_isCoherent as isCoherent, brain_kuramotoStep as kuramotoStep, brain_orderParameter as orderParameter, brain_phaseLockingValue as phaseLockingValue, brain_wrapTo2Pi as wrapTo2Pi, brain_wrapToPi as wrapToPi };
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
/**
|
|
2500
|
+
* Agent Communication Bus — in-memory message passing for skill agents.
|
|
2617
2501
|
*
|
|
2618
|
-
*
|
|
2619
|
-
*
|
|
2502
|
+
* Scoped per skill run. Agents publish findings, review requests, and
|
|
2503
|
+
* delegation requests. Downstream agents receive accumulated context
|
|
2504
|
+
* via their system prompt.
|
|
2620
2505
|
*
|
|
2621
|
-
* @
|
|
2622
|
-
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
2623
|
-
* @module core/L0/realizability
|
|
2506
|
+
* @module skills/agent-bus
|
|
2624
2507
|
*/
|
|
2625
|
-
|
|
2626
|
-
interface
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
/** Output sematons produced by this step */
|
|
2632
|
-
outputs: Sematon[];
|
|
2633
|
-
/** Convergence witness at this step */
|
|
2634
|
-
witness: SematonWitness;
|
|
2635
|
-
/** Total information content of outputs (bits) */
|
|
2636
|
-
informationGain: number;
|
|
2637
|
-
/** Timestamp */
|
|
2508
|
+
type AgentMessageType = "finding" | "question" | "review_request" | "review_response" | "delegation_request" | "delegation_response";
|
|
2509
|
+
interface AgentMessage {
|
|
2510
|
+
fromAgent: string;
|
|
2511
|
+
toAgent?: string;
|
|
2512
|
+
type: AgentMessageType;
|
|
2513
|
+
payload: string;
|
|
2638
2514
|
timestamp: number;
|
|
2515
|
+
runId: string;
|
|
2639
2516
|
}
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
/** Count of constructive (realizable) steps */
|
|
2650
|
-
constructiveSteps: number;
|
|
2651
|
-
/** Creation timestamp */
|
|
2652
|
-
createdAt: number;
|
|
2653
|
-
}
|
|
2654
|
-
interface VerificationSuccess {
|
|
2655
|
-
valid: true;
|
|
2656
|
-
totalInfoGain: number;
|
|
2657
|
-
constructiveSteps: number;
|
|
2658
|
-
}
|
|
2659
|
-
interface VerificationFailure {
|
|
2660
|
-
valid: false;
|
|
2661
|
-
failureStep: number;
|
|
2662
|
-
reason: string;
|
|
2517
|
+
type MessageHandler = (msg: AgentMessage) => void;
|
|
2518
|
+
interface AgentBus {
|
|
2519
|
+
publish(msg: AgentMessage): void;
|
|
2520
|
+
query(filter: {
|
|
2521
|
+
fromAgent?: string;
|
|
2522
|
+
type?: string;
|
|
2523
|
+
}): AgentMessage[];
|
|
2524
|
+
subscribe(agentId: string, handler: MessageHandler): () => void;
|
|
2525
|
+
getAll(): AgentMessage[];
|
|
2663
2526
|
}
|
|
2664
|
-
type VerificationResult = VerificationSuccess | VerificationFailure;
|
|
2665
2527
|
/**
|
|
2666
|
-
* Create a single
|
|
2667
|
-
*
|
|
2528
|
+
* Create an AgentBus scoped to a single skill run.
|
|
2529
|
+
* Messages are stored in-memory (array). No persistence needed —
|
|
2530
|
+
* the bus lifetime matches the SkillRunner instance.
|
|
2668
2531
|
*/
|
|
2669
|
-
declare function
|
|
2532
|
+
declare function createAgentBus(runId: string): AgentBus;
|
|
2533
|
+
|
|
2670
2534
|
/**
|
|
2671
|
-
*
|
|
2672
|
-
*
|
|
2535
|
+
* Protocol SDK — MCP and A2A protocol connections
|
|
2536
|
+
*
|
|
2537
|
+
* Delegation primitives and agent communication types.
|
|
2538
|
+
* Hides MCP client lifecycle, A2A internals.
|
|
2539
|
+
*
|
|
2540
|
+
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
2541
|
+
* @module sdk/protocol
|
|
2673
2542
|
*/
|
|
2674
|
-
|
|
2543
|
+
|
|
2544
|
+
type protocol_AgentBus = AgentBus;
|
|
2545
|
+
type protocol_AgentMessage = AgentMessage;
|
|
2546
|
+
type protocol_AgentMessageType = AgentMessageType;
|
|
2547
|
+
type protocol_DelegationChain = DelegationChain;
|
|
2548
|
+
type protocol_DelegationEdge<S = SurfaceId, T = SurfaceId> = DelegationEdge<S, T>;
|
|
2549
|
+
type protocol_DelegationEdgeInput<S = SurfaceId, T = SurfaceId> = DelegationEdgeInput<S, T>;
|
|
2550
|
+
type protocol_DelegationEndpoint<S = SurfaceId> = DelegationEndpoint<S>;
|
|
2551
|
+
declare const protocol_createAgentBus: typeof createAgentBus;
|
|
2552
|
+
declare const protocol_createDelegationChain: typeof createDelegationChain;
|
|
2553
|
+
declare const protocol_createDelegationEdge: typeof createDelegationEdge;
|
|
2554
|
+
declare const protocol_isValidSurfaceId: typeof isValidSurfaceId;
|
|
2555
|
+
declare namespace protocol {
|
|
2556
|
+
export { type protocol_AgentBus as AgentBus, type protocol_AgentMessage as AgentMessage, type protocol_AgentMessageType as AgentMessageType, type protocol_DelegationChain as DelegationChain, type protocol_DelegationEdge as DelegationEdge, type protocol_DelegationEdgeInput as DelegationEdgeInput, type protocol_DelegationEndpoint as DelegationEndpoint, protocol_createAgentBus as createAgentBus, protocol_createDelegationChain as createDelegationChain, protocol_createDelegationEdge as createDelegationEdge, protocol_isValidSurfaceId as isValidSurfaceId };
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
type NodePolicy = NodePolicy$1;
|
|
2560
|
+
type StackPolicies = StackPolicies$1;
|
|
2675
2561
|
/**
|
|
2676
|
-
*
|
|
2677
|
-
* 1. Each step's inputs must all be realizable
|
|
2678
|
-
* 2. Each step's witness must have converged
|
|
2679
|
-
* 3. Information is non-decreasing across steps
|
|
2562
|
+
* Runtime tier for node execution.
|
|
2680
2563
|
*
|
|
2681
|
-
*
|
|
2564
|
+
* Defines the execution environment for computational nodes:
|
|
2565
|
+
* - `worker`: Web Worker/service worker
|
|
2566
|
+
* - `container-lite`: Lightweight containerized runtime
|
|
2567
|
+
* - `webcontainer`: Browser-based container (WebAssembly)
|
|
2568
|
+
* - `edge`: Edge function/serverless
|
|
2569
|
+
* - `wasm-hvm`: WebAssembly with HVM (Higher-order Virtual Machine)
|
|
2570
|
+
* - `stack`: Nested stack execution
|
|
2571
|
+
*
|
|
2572
|
+
* @example
|
|
2573
|
+
* const tier: RuntimeTier = "worker";
|
|
2682
2574
|
*/
|
|
2683
|
-
|
|
2575
|
+
type RuntimeTier = "worker" | "container-lite" | "webcontainer" | "edge" | "wasm-hvm" | "stack";
|
|
2684
2576
|
/**
|
|
2685
|
-
*
|
|
2686
|
-
*
|
|
2577
|
+
* Base manifest fields shared by nodes and stacks.
|
|
2578
|
+
*
|
|
2579
|
+
* @internal
|
|
2687
2580
|
*/
|
|
2688
|
-
|
|
2581
|
+
interface BaseManifestV0 {
|
|
2582
|
+
/** Unique identifier (must be stable across versions) */
|
|
2583
|
+
id: string;
|
|
2584
|
+
/** Semantic version (e.g., "1.0.0") */
|
|
2585
|
+
version: string;
|
|
2586
|
+
/** Human-readable name */
|
|
2587
|
+
name?: string;
|
|
2588
|
+
/** Description of functionality */
|
|
2589
|
+
description?: string;
|
|
2590
|
+
/** Security and resource policies */
|
|
2591
|
+
policies?: NodePolicy | StackPolicies;
|
|
2592
|
+
/** Arbitrary metadata for extensions */
|
|
2593
|
+
metadata?: Record<string, unknown>;
|
|
2594
|
+
}
|
|
2689
2595
|
/**
|
|
2690
|
-
*
|
|
2691
|
-
*
|
|
2596
|
+
* Stack-level secret scope definition.
|
|
2597
|
+
*
|
|
2598
|
+
* Defines which nodes can access a secret.
|
|
2599
|
+
*
|
|
2600
|
+
* @example
|
|
2601
|
+
* const secretScope: StackSecretScope = {
|
|
2602
|
+
* scope: ["fetch-node", "transform-node"],
|
|
2603
|
+
* required: true
|
|
2604
|
+
* };
|
|
2692
2605
|
*/
|
|
2693
|
-
|
|
2694
|
-
|
|
2606
|
+
interface StackSecretScope {
|
|
2607
|
+
/** Node IDs that can access this secret */
|
|
2608
|
+
scope: string[];
|
|
2609
|
+
/** Whether secret must exist */
|
|
2610
|
+
required?: boolean;
|
|
2611
|
+
}
|
|
2695
2612
|
/**
|
|
2696
|
-
*
|
|
2613
|
+
* Stack-level runtime tier configuration.
|
|
2697
2614
|
*
|
|
2698
|
-
*
|
|
2699
|
-
* for cross-layer mappings in the AXON architecture.
|
|
2615
|
+
* Allows stack-wide defaults with per-node overrides.
|
|
2700
2616
|
*
|
|
2701
|
-
* @
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
type index_InformationPreservation = InformationPreservation;
|
|
2715
|
-
type index_Iso<A, B> = Iso<A, B>;
|
|
2716
|
-
type index_IsoMeta = IsoMeta;
|
|
2717
|
-
declare const index_LAYERS: typeof LAYERS;
|
|
2718
|
-
type index_LayerBridge<From extends LayerId, To extends LayerId, A, B> = LayerBridge<From, To, A, B>;
|
|
2719
|
-
type index_LayerId = LayerId;
|
|
2720
|
-
type index_LayerMeta = LayerMeta;
|
|
2721
|
-
type index_Morphism<A, B> = Morphism<A, B>;
|
|
2722
|
-
type index_NaturalTransformation<F, G> = NaturalTransformation<F, G>;
|
|
2723
|
-
type index_Product<A, B> = Product<A, B>;
|
|
2724
|
-
type index_Proof<P> = Proof<P>;
|
|
2725
|
-
type index_RealizabilityStep = RealizabilityStep;
|
|
2726
|
-
type index_RealizabilityTrace = RealizabilityTrace;
|
|
2727
|
-
type index_SemanticDensity = SemanticDensity;
|
|
2728
|
-
type index_Sematon<T = unknown> = Sematon<T>;
|
|
2729
|
-
type index_SematonConfig<T> = SematonConfig<T>;
|
|
2730
|
-
type index_SematonKind = SematonKind;
|
|
2731
|
-
type index_SematonWitness = SematonWitness;
|
|
2732
|
-
type index_TypeShape = TypeShape;
|
|
2733
|
-
declare const index_VALID_TRANSITIONS: typeof VALID_TRANSITIONS;
|
|
2734
|
-
type index_VerificationFailure = VerificationFailure;
|
|
2735
|
-
type index_VerificationResult = VerificationResult;
|
|
2736
|
-
type index_VerificationSuccess = VerificationSuccess;
|
|
2737
|
-
type index_Verified<T, P> = Verified<T, P>;
|
|
2738
|
-
declare const index_calculateSemanticDensity: typeof calculateSemanticDensity;
|
|
2739
|
-
declare const index_canEmbed: typeof canEmbed;
|
|
2740
|
-
declare const index_checkCompatibility: typeof checkCompatibility;
|
|
2741
|
-
declare const index_compose: typeof compose;
|
|
2742
|
-
declare const index_composeAsync: typeof composeAsync;
|
|
2743
|
-
declare const index_composeIso: typeof composeIso;
|
|
2744
|
-
declare const index_conditionalEntropy: typeof conditionalEntropy;
|
|
2745
|
-
declare const index_cosineSimilarity: typeof cosineSimilarity;
|
|
2746
|
-
declare const index_createBridge: typeof createBridge;
|
|
2747
|
-
declare const index_createRealizabilityStep: typeof createRealizabilityStep;
|
|
2748
|
-
declare const index_createSematon: typeof createSematon;
|
|
2749
|
-
declare const index_deriveFieldMappings: typeof deriveFieldMappings;
|
|
2750
|
-
declare const index_deriveIsomorphism: typeof deriveIsomorphism;
|
|
2751
|
-
declare const index_entropy: typeof entropy;
|
|
2752
|
-
declare const index_estimateComplexity: typeof estimateComplexity;
|
|
2753
|
-
declare const index_extractShape: typeof extractShape;
|
|
2754
|
-
declare const index_fold: typeof fold;
|
|
2755
|
-
declare const index_foldSematon: typeof foldSematon;
|
|
2756
|
-
declare const index_foldTrace: typeof foldTrace;
|
|
2757
|
-
declare const index_identity: typeof identity;
|
|
2758
|
-
declare const index_identityIso: typeof identityIso;
|
|
2759
|
-
declare const index_invertIso: typeof invertIso;
|
|
2760
|
-
declare const index_isRealizable: typeof isRealizable;
|
|
2761
|
-
declare const index_isValidTransition: typeof isValidTransition;
|
|
2762
|
-
declare const index_jointEntropy: typeof jointEntropy;
|
|
2763
|
-
declare const index_jsDivergence: typeof jsDivergence;
|
|
2764
|
-
declare const index_klDivergence: typeof klDivergence;
|
|
2765
|
-
declare const index_left: typeof left;
|
|
2766
|
-
declare const index_measurePreservation: typeof measurePreservation;
|
|
2767
|
-
declare const index_mutualInformation: typeof mutualInformation;
|
|
2768
|
-
declare const index_normalize: typeof normalize;
|
|
2769
|
-
declare const index_right: typeof right;
|
|
2770
|
-
declare const index_sematonDensity: typeof sematonDensity;
|
|
2771
|
-
declare const index_sematonDistance: typeof sematonDistance;
|
|
2772
|
-
declare const index_sematonEntropy: typeof sematonEntropy;
|
|
2773
|
-
declare const index_shapeSimilarity: typeof shapeSimilarity;
|
|
2774
|
-
declare const index_traceRealizability: typeof traceRealizability;
|
|
2775
|
-
declare const index_unfoldSematon: typeof unfoldSematon;
|
|
2776
|
-
declare const index_unfoldTrace: typeof unfoldTrace;
|
|
2777
|
-
declare const index_verifyIsomorphism: typeof verifyIsomorphism;
|
|
2778
|
-
declare const index_verifyTrace: typeof verifyTrace;
|
|
2779
|
-
declare namespace index {
|
|
2780
|
-
export { type index_AsyncIso as AsyncIso, type index_AsyncMorphism as AsyncMorphism, type index_Category as Category, type index_Coproduct as Coproduct, type index_DerivationOptions as DerivationOptions, type index_DerivedIso as DerivedIso, type index_Embed as Embed, type index_FieldMapping as FieldMapping, type index_FoldedSematon as FoldedSematon, type index_Functor as Functor, type index_InformationPreservation as InformationPreservation, type index_Iso as Iso, type index_IsoMeta as IsoMeta, index_LAYERS as LAYERS, type index_LayerBridge as LayerBridge, type index_LayerId as LayerId, type index_LayerMeta as LayerMeta, type index_Morphism as Morphism, type index_NaturalTransformation as NaturalTransformation, type index_Product as Product, type index_Proof as Proof, type index_RealizabilityStep as RealizabilityStep, type index_RealizabilityTrace as RealizabilityTrace, type index_SemanticDensity as SemanticDensity, type index_Sematon as Sematon, type index_SematonConfig as SematonConfig, type index_SematonKind as SematonKind, type index_SematonWitness as SematonWitness, type index_TypeShape as TypeShape, index_VALID_TRANSITIONS as VALID_TRANSITIONS, type index_VerificationFailure as VerificationFailure, type index_VerificationResult as VerificationResult, type index_VerificationSuccess as VerificationSuccess, type index_Verified as Verified, index_calculateSemanticDensity as calculateSemanticDensity, index_canEmbed as canEmbed, index_checkCompatibility as checkCompatibility, index_compose as compose, index_composeAsync as composeAsync, index_composeIso as composeIso, index_conditionalEntropy as conditionalEntropy, index_cosineSimilarity as cosineSimilarity, index_createBridge as createBridge, index_createRealizabilityStep as createRealizabilityStep, index_createSematon as createSematon, index_deriveFieldMappings as deriveFieldMappings, index_deriveIsomorphism as deriveIsomorphism, index_entropy as entropy, index_estimateComplexity as estimateComplexity, index_extractShape as extractShape, index_fold as fold, index_foldSematon as foldSematon, index_foldTrace as foldTrace, index_identity as identity, index_identityIso as identityIso, index_invertIso as invertIso, index_isRealizable as isRealizable, index_isValidTransition as isValidTransition, index_jointEntropy as jointEntropy, index_jsDivergence as jsDivergence, index_klDivergence as klDivergence, index_left as left, index_measurePreservation as measurePreservation, index_mutualInformation as mutualInformation, index_normalize as normalize, index_right as right, index_sematonDensity as sematonDensity, index_sematonDistance as sematonDistance, index_sematonEntropy as sematonEntropy, index_shapeSimilarity as shapeSimilarity, index_traceRealizability as traceRealizability, index_unfoldSematon as unfoldSematon, index_unfoldTrace as unfoldTrace, index_verifyIsomorphism as verifyIsomorphism, index_verifyTrace as verifyTrace };
|
|
2617
|
+
* @example
|
|
2618
|
+
* const runtimes: StackRuntimes = {
|
|
2619
|
+
* default: ["worker", "edge"],
|
|
2620
|
+
* overrides: {
|
|
2621
|
+
* "heavy-compute": ["container-lite"]
|
|
2622
|
+
* }
|
|
2623
|
+
* };
|
|
2624
|
+
*/
|
|
2625
|
+
interface StackRuntimes {
|
|
2626
|
+
/** Default runtime tiers for all nodes */
|
|
2627
|
+
default?: RuntimeTier[];
|
|
2628
|
+
/** Per-node runtime tier overrides (nodeId -> tiers) */
|
|
2629
|
+
overrides?: Record<string, RuntimeTier[]>;
|
|
2781
2630
|
}
|
|
2782
|
-
|
|
2783
2631
|
/**
|
|
2784
|
-
*
|
|
2632
|
+
* Node configuration within a stack.
|
|
2785
2633
|
*
|
|
2786
|
-
*
|
|
2787
|
-
* All executors interpret this algebra into effects.
|
|
2634
|
+
* References a node manifest and provides instance-specific config.
|
|
2788
2635
|
*
|
|
2789
|
-
* @
|
|
2636
|
+
* @example
|
|
2637
|
+
* const nodeConfig: StackNodeConfig = {
|
|
2638
|
+
* id: "fetch-1",
|
|
2639
|
+
* nodeRef: "http-fetch",
|
|
2640
|
+
* config: { timeout: 5000 },
|
|
2641
|
+
* runtimes: ["edge"],
|
|
2642
|
+
* secrets: ["api_key"]
|
|
2643
|
+
* };
|
|
2790
2644
|
*/
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
kind: "surface";
|
|
2794
|
-
surface: SurfaceId;
|
|
2795
|
-
} | {
|
|
2796
|
-
kind: "tab";
|
|
2797
|
-
tab: string;
|
|
2798
|
-
} | {
|
|
2799
|
-
kind: "route";
|
|
2800
|
-
path: string;
|
|
2801
|
-
params?: Record<string, string>;
|
|
2802
|
-
} | {
|
|
2803
|
-
kind: "focus";
|
|
2804
|
-
elementId: string;
|
|
2805
|
-
} | {
|
|
2806
|
-
kind: "relative";
|
|
2807
|
-
direction: "up" | "down" | "left" | "right";
|
|
2808
|
-
};
|
|
2809
|
-
type SkillRef = {
|
|
2810
|
-
kind: "slug";
|
|
2811
|
-
slug: string;
|
|
2812
|
-
} | {
|
|
2813
|
-
kind: "id";
|
|
2645
|
+
interface StackNodeConfig {
|
|
2646
|
+
/** Unique ID within stack */
|
|
2814
2647
|
id: string;
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2648
|
+
/** Reference to NodeManifestV0.id */
|
|
2649
|
+
nodeRef: string;
|
|
2650
|
+
/** Node-specific configuration */
|
|
2651
|
+
config?: Record<string, unknown>;
|
|
2652
|
+
/** Runtime tier override */
|
|
2653
|
+
runtimes?: RuntimeTier[];
|
|
2654
|
+
/** Security policy override */
|
|
2655
|
+
policies?: NodePolicy;
|
|
2656
|
+
/** Secret names from stack.secrets */
|
|
2657
|
+
secrets?: string[];
|
|
2823
2658
|
}
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
}
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2659
|
+
/**
|
|
2660
|
+
* Directed edge connecting two nodes in the stack DAG.
|
|
2661
|
+
*
|
|
2662
|
+
* Defines data flow from one node's outputs to another's inputs.
|
|
2663
|
+
*
|
|
2664
|
+
* @example
|
|
2665
|
+
* const edge: StackEdge = {
|
|
2666
|
+
* from: "fetch-1",
|
|
2667
|
+
* to: "transform-1",
|
|
2668
|
+
* map: { "data": "input" }
|
|
2669
|
+
* };
|
|
2670
|
+
*/
|
|
2671
|
+
interface StackEdge {
|
|
2672
|
+
/** Source node ID */
|
|
2673
|
+
from: string;
|
|
2674
|
+
/** Target node ID */
|
|
2675
|
+
to: string;
|
|
2676
|
+
/** Output-to-input key mapping (defaults to identity) */
|
|
2677
|
+
map?: Record<string, string>;
|
|
2838
2678
|
}
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2679
|
+
/**
|
|
2680
|
+
* Manifest layer provenance.
|
|
2681
|
+
*
|
|
2682
|
+
* - `L0`: Landing/Zero layer (low-level primitives)
|
|
2683
|
+
* - `L1`: Compose/Platform layer (higher-level abstractions)
|
|
2684
|
+
*/
|
|
2685
|
+
type ManifestLayer = "L0" | "L1" | "L2" | "L3" | "L4" | "L5";
|
|
2686
|
+
/**
|
|
2687
|
+
* Stack manifest for DAG orchestrator.
|
|
2688
|
+
*
|
|
2689
|
+
* Defines a complete workflow as a directed acyclic graph (DAG) of nodes.
|
|
2690
|
+
*
|
|
2691
|
+
* @example
|
|
2692
|
+
* const stack: StackManifestV0 = {
|
|
2693
|
+
* id: "data-pipeline",
|
|
2694
|
+
* version: "1.0.0",
|
|
2695
|
+
* nodes: [
|
|
2696
|
+
* { id: "fetch", nodeRef: "http-fetch", config: { url: "..." } },
|
|
2697
|
+
* { id: "transform", nodeRef: "llm-transform" }
|
|
2698
|
+
* ],
|
|
2699
|
+
* edges: [
|
|
2700
|
+
* { from: "fetch", to: "transform", map: { data: "input" } }
|
|
2701
|
+
* ],
|
|
2702
|
+
* secrets: {
|
|
2703
|
+
* api_key: { scope: ["fetch"], required: true }
|
|
2704
|
+
* }
|
|
2705
|
+
* };
|
|
2706
|
+
*/
|
|
2707
|
+
interface StackManifestV0 extends BaseManifestV0 {
|
|
2708
|
+
/** Node instances in this stack */
|
|
2709
|
+
nodes: StackNodeConfig[];
|
|
2710
|
+
/** Edges connecting nodes (data flow) */
|
|
2711
|
+
edges?: StackEdge[];
|
|
2712
|
+
/** Stack-level secret definitions */
|
|
2713
|
+
secrets?: Record<string, StackSecretScope>;
|
|
2714
|
+
/** Runtime tier configuration */
|
|
2715
|
+
runtimes?: StackRuntimes;
|
|
2716
|
+
/** Provenance layer (L0 or L1) */
|
|
2717
|
+
layer?: ManifestLayer;
|
|
2875
2718
|
}
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2719
|
+
|
|
2720
|
+
/**
|
|
2721
|
+
* Skill Manifest Types (L1)
|
|
2722
|
+
*
|
|
2723
|
+
* Core types for the Skills Platform. A SkillManifest extends StackManifestV0
|
|
2724
|
+
* with skill-specific metadata — a skill IS a stack with agent orchestration.
|
|
2725
|
+
*
|
|
2726
|
+
* @module skills/types
|
|
2727
|
+
*/
|
|
2728
|
+
|
|
2729
|
+
type SkillCategory = "startup" | "legal" | "finance" | "engineering" | "content" | "research" | "operations" | "marketing" | "verification";
|
|
2730
|
+
type SkillOutputType = "document" | "website" | "spreadsheet" | "presentation" | "codebase" | "analysis" | "dataset" | "visual" | "video" | "audio" | "composite";
|
|
2731
|
+
declare const SKILL_CATEGORIES: readonly SkillCategory[];
|
|
2732
|
+
declare const SKILL_TIERS: readonly ["flagship", "professional", "utility"];
|
|
2733
|
+
type SkillTier = (typeof SKILL_TIERS)[number];
|
|
2734
|
+
declare const SKILL_RANKS: readonly ["skill", "flow", "fleet", "org", "society"];
|
|
2735
|
+
type SkillRank = (typeof SKILL_RANKS)[number];
|
|
2736
|
+
/** Effective-dated rank assignment — immutable audit trail */
|
|
2737
|
+
interface RankAssignment {
|
|
2738
|
+
/** Current rank */
|
|
2739
|
+
rank: SkillRank;
|
|
2740
|
+
/** ISO 8601 timestamp when this rank became effective */
|
|
2741
|
+
effectiveFrom: string;
|
|
2742
|
+
/** ISO 8601 timestamp when this rank was superseded (null = current) */
|
|
2743
|
+
effectiveTo: string | null;
|
|
2744
|
+
/** Evidence that promotion invariants were satisfied */
|
|
2745
|
+
proof?: PromotionProof;
|
|
2882
2746
|
}
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2747
|
+
/**
|
|
2748
|
+
* Promotion proof — the Curry-Howard witness type.
|
|
2749
|
+
* Each promotion requires structural evidence that the entity
|
|
2750
|
+
* satisfies the invariants of the target rank.
|
|
2751
|
+
*/
|
|
2752
|
+
interface PromotionProof {
|
|
2753
|
+
/** Source rank */
|
|
2754
|
+
from: SkillRank;
|
|
2755
|
+
/** Target rank */
|
|
2756
|
+
to: SkillRank;
|
|
2757
|
+
/** Structural invariant checks that passed */
|
|
2758
|
+
invariants: PromotionInvariant[];
|
|
2759
|
+
/** Timestamp of promotion evaluation */
|
|
2760
|
+
evaluatedAt: string;
|
|
2761
|
+
/** Quality score at time of promotion (0-1) */
|
|
2762
|
+
qualityScore: number;
|
|
2888
2763
|
}
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2764
|
+
interface PromotionInvariant {
|
|
2765
|
+
/** Invariant name (e.g., "has_convergence", "has_3_plus_skills", "has_mesh_events") */
|
|
2766
|
+
name: string;
|
|
2767
|
+
/** Whether this invariant was satisfied */
|
|
2768
|
+
satisfied: boolean;
|
|
2769
|
+
/** Human-readable evidence */
|
|
2770
|
+
evidence?: string;
|
|
2771
|
+
}
|
|
2772
|
+
interface SkillCapabilities {
|
|
2773
|
+
/** Allow image generation via connected media providers */
|
|
2774
|
+
allowImageGen?: boolean;
|
|
2775
|
+
/** Allow video generation via connected media providers */
|
|
2776
|
+
allowVideoGen?: boolean;
|
|
2777
|
+
/** Allow MCP tool access during execution */
|
|
2778
|
+
allowTools?: boolean;
|
|
2779
|
+
/** Allow web search during execution */
|
|
2780
|
+
allowWebSearch?: boolean;
|
|
2781
|
+
/** Allow code execution in sandbox */
|
|
2782
|
+
allowCodeExec?: boolean;
|
|
2902
2783
|
}
|
|
2903
|
-
interface
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2784
|
+
interface SkillHealth {
|
|
2785
|
+
/** Overall health score 0-100 */
|
|
2786
|
+
score: number;
|
|
2787
|
+
/** Health grade derived from score */
|
|
2788
|
+
grade: "A" | "B" | "C" | "D" | "F";
|
|
2789
|
+
/** Last N run outcomes for sparkline display */
|
|
2790
|
+
recentRuns: SkillRunSummary[];
|
|
2791
|
+
/** Average convergence iterations across recent runs */
|
|
2792
|
+
avgConvergenceIterations: number;
|
|
2793
|
+
/** Average quality score across recent runs (0-1) */
|
|
2794
|
+
avgQualityScore: number;
|
|
2795
|
+
/** Success rate as percentage (0-100) */
|
|
2796
|
+
successRate: number;
|
|
2797
|
+
/** Last run timestamp */
|
|
2798
|
+
lastRunAt: string | null;
|
|
2799
|
+
/** Total run count */
|
|
2800
|
+
totalRuns: number;
|
|
2801
|
+
}
|
|
2802
|
+
interface SkillRunSummary {
|
|
2803
|
+
/** Run ID */
|
|
2804
|
+
runId: string;
|
|
2805
|
+
/** Run status */
|
|
2806
|
+
status: "completed" | "failed" | "cancelled";
|
|
2807
|
+
/** Quality score (0-1) */
|
|
2808
|
+
qualityScore: number;
|
|
2809
|
+
/** Duration in seconds */
|
|
2810
|
+
duration: number;
|
|
2811
|
+
/** Timestamp */
|
|
2812
|
+
timestamp: string;
|
|
2907
2813
|
}
|
|
2908
|
-
interface
|
|
2909
|
-
|
|
2910
|
-
|
|
2814
|
+
interface SkillAgent {
|
|
2815
|
+
/** Agent role name (e.g., "Market Researcher", "Legal Analyst") */
|
|
2816
|
+
role: string;
|
|
2817
|
+
/** What this agent does in the workflow */
|
|
2818
|
+
description: string;
|
|
2819
|
+
/** Maps to a NodeManifestV0.id in the stack */
|
|
2820
|
+
nodeRef?: string;
|
|
2821
|
+
/** When true, a synthetic peer reviewer evaluates this agent's output after completion */
|
|
2822
|
+
peerReview?: boolean;
|
|
2911
2823
|
}
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2824
|
+
interface SkillSampleOutput {
|
|
2825
|
+
type: SkillOutputType;
|
|
2826
|
+
title: string;
|
|
2827
|
+
/** Screenshot or live preview URL */
|
|
2828
|
+
previewUrl?: string;
|
|
2829
|
+
description: string;
|
|
2830
|
+
}
|
|
2831
|
+
/** External service dependency for a skill */
|
|
2832
|
+
interface SkillServiceRequirement {
|
|
2833
|
+
/** Unique key for this requirement (e.g., "search", "database", "email") */
|
|
2834
|
+
key: string;
|
|
2835
|
+
/** Human-readable label */
|
|
2916
2836
|
label: string;
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2837
|
+
/** Type of service needed */
|
|
2838
|
+
type: "mcp" | "api" | "credential";
|
|
2839
|
+
/** Description of what this service is used for */
|
|
2840
|
+
description: string;
|
|
2841
|
+
/** Whether this service is required or optional */
|
|
2842
|
+
required: boolean;
|
|
2843
|
+
/** Suggested MCP server names (for type: "mcp") */
|
|
2844
|
+
suggestedServers?: string[];
|
|
2921
2845
|
}
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
/**
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2846
|
+
interface SkillMeta<TInput extends Record<string, unknown> = Record<string, unknown>> {
|
|
2847
|
+
/** Unique skill slug (url-safe) */
|
|
2848
|
+
slug: string;
|
|
2849
|
+
/** Display name */
|
|
2850
|
+
title: string;
|
|
2851
|
+
/** One-line value proposition */
|
|
2852
|
+
tagline: string;
|
|
2853
|
+
/** Detailed description (markdown) */
|
|
2854
|
+
description: string;
|
|
2855
|
+
/** Skill category */
|
|
2856
|
+
category: SkillCategory;
|
|
2857
|
+
/** Skill tier (complexity/impact level) */
|
|
2858
|
+
tier: SkillTier;
|
|
2859
|
+
/** Expected output artifact types */
|
|
2860
|
+
outputs: SkillOutputType[];
|
|
2861
|
+
/** Estimated execution time range in seconds [min, max] */
|
|
2862
|
+
estimatedTime: [number, number];
|
|
2863
|
+
/** Required input schema (JSON Schema) */
|
|
2864
|
+
inputSchema: JSONSchema7;
|
|
2865
|
+
/** Agent roles involved in this skill */
|
|
2866
|
+
agents: SkillAgent[];
|
|
2867
|
+
/** Sample input for demo/preview (typed to match inputSchema) */
|
|
2868
|
+
sampleInput?: TInput;
|
|
2869
|
+
/** Sample output artifacts for showcase */
|
|
2870
|
+
sampleOutputs?: SkillSampleOutput[];
|
|
2871
|
+
/** Tags for filtering */
|
|
2872
|
+
tags: string[];
|
|
2873
|
+
/** Author */
|
|
2874
|
+
author: string;
|
|
2875
|
+
/** Icon identifier (from icon set) */
|
|
2876
|
+
icon?: string;
|
|
2877
|
+
/** Cosmic gradient pair index (0-7 from cosmicGradients) */
|
|
2878
|
+
gradientIndex?: number;
|
|
2879
|
+
/** Output schema for composition chaining (JSON Schema) */
|
|
2880
|
+
outputSchema?: JSONSchema7;
|
|
2881
|
+
/** Allow agents to dynamically delegate tasks to ephemeral agents. Max 2 per run. */
|
|
2882
|
+
allowDelegation?: boolean;
|
|
2883
|
+
/** External service dependencies (MCP servers, APIs, credentials) */
|
|
2884
|
+
services?: SkillServiceRequirement[];
|
|
2885
|
+
/** Runtime capability toggles (image gen, video gen, tools, etc.) */
|
|
2886
|
+
capabilities?: SkillCapabilities;
|
|
2887
|
+
/** Current rank in the hierarchy (default: "skill") */
|
|
2888
|
+
rank?: SkillRank;
|
|
2889
|
+
/** Effective-dated rank history — immutable audit trail */
|
|
2890
|
+
rankHistory?: RankAssignment[];
|
|
2891
|
+
/**
|
|
2892
|
+
* Convergence configuration for iterative agent output refinement.
|
|
2893
|
+
*
|
|
2894
|
+
* Future optimization: the manual convergence loop in runner.ts could be
|
|
2895
|
+
* replaced by `withRetry()` + `withCircuitBreaker()` from
|
|
2896
|
+
* `lib/terminals-tech/core/primitives/middleware` — they provide the same
|
|
2897
|
+
* retry/backoff/threshold semantics with composable middleware chaining.
|
|
2898
|
+
* See also `createRefinementLoop()` from `primitives/refinement` which
|
|
2899
|
+
* encapsulates the score/delta/plateau logic as a standalone primitive.
|
|
2900
|
+
*/
|
|
2901
|
+
convergence?: {
|
|
2902
|
+
/** Max refinement iterations per agent. Default 1 (no refinement), max 5. */
|
|
2903
|
+
maxIterations: number;
|
|
2904
|
+
/** Quality threshold (0-1). Agent output must meet this to pass. Default 0.7. */
|
|
2905
|
+
qualityThreshold: number;
|
|
2906
|
+
/** Minimum quality improvement per iteration. Stops early if delta < this. Default 0.05. */
|
|
2907
|
+
minDelta: number;
|
|
2908
|
+
/** Refinement strategy: retry (re-execute), critique (LLM critic), refine (critique + inject feedback). */
|
|
2909
|
+
strategy: "retry" | "critique" | "refine";
|
|
2947
2910
|
};
|
|
2948
|
-
"context:changed": ActionContext;
|
|
2949
|
-
};
|
|
2950
|
-
declare function getActionBus(): TypedEventBus<ActionBusEvents>;
|
|
2951
|
-
declare function dispatchAction(event: ActionEvent): void;
|
|
2952
|
-
declare function onAction(handler: (event: ActionEvent) => void): () => void;
|
|
2953
|
-
|
|
2954
|
-
/**
|
|
2955
|
-
* Mesh SDK — Event emission, subscription, and query
|
|
2956
|
-
*
|
|
2957
|
-
* Cross-layer communication via signals and the action bus.
|
|
2958
|
-
* Hides Interaction primitive internals, SDKMessage, AXON internals.
|
|
2959
|
-
*
|
|
2960
|
-
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
2961
|
-
* @module sdk/mesh
|
|
2962
|
-
*/
|
|
2963
|
-
|
|
2964
|
-
type mesh_Action = Action;
|
|
2965
|
-
type mesh_ActionBinding = ActionBinding;
|
|
2966
|
-
type mesh_ActionBusEvents = ActionBusEvents;
|
|
2967
|
-
type mesh_ActionContext = ActionContext;
|
|
2968
|
-
type mesh_ActionEvent = ActionEvent;
|
|
2969
|
-
type mesh_InputSurface = InputSurface;
|
|
2970
|
-
type mesh_Signal<T = unknown> = Signal<T>;
|
|
2971
|
-
type mesh_SignalBus = SignalBus;
|
|
2972
|
-
type mesh_SignalHandler<T = unknown> = SignalHandler<T>;
|
|
2973
|
-
type mesh_SignalType = SignalType;
|
|
2974
|
-
declare const mesh_createSignalBus: typeof createSignalBus;
|
|
2975
|
-
declare const mesh_delegateAndWatch: typeof delegateAndWatch;
|
|
2976
|
-
declare const mesh_dispatchAction: typeof dispatchAction;
|
|
2977
|
-
declare const mesh_emitSignal: typeof emitSignal;
|
|
2978
|
-
declare const mesh_getActionBus: typeof getActionBus;
|
|
2979
|
-
declare const mesh_getSignalBus: typeof getSignalBus;
|
|
2980
|
-
declare const mesh_goAndRun: typeof goAndRun;
|
|
2981
|
-
declare const mesh_onAction: typeof onAction;
|
|
2982
|
-
declare const mesh_seq: typeof seq;
|
|
2983
|
-
declare const mesh_subscribeToSignals: typeof subscribeToSignals;
|
|
2984
|
-
declare namespace mesh {
|
|
2985
|
-
export { type mesh_Action as Action, type mesh_ActionBinding as ActionBinding, type mesh_ActionBusEvents as ActionBusEvents, type mesh_ActionContext as ActionContext, type mesh_ActionEvent as ActionEvent, type mesh_InputSurface as InputSurface, type mesh_Signal as Signal, type mesh_SignalBus as SignalBus, type mesh_SignalHandler as SignalHandler, type mesh_SignalType as SignalType, mesh_createSignalBus as createSignalBus, mesh_delegateAndWatch as delegateAndWatch, mesh_dispatchAction as dispatchAction, mesh_emitSignal as emitSignal, mesh_getActionBus as getActionBus, mesh_getSignalBus as getSignalBus, mesh_goAndRun as goAndRun, mesh_onAction as onAction, mesh_seq as seq, mesh_subscribeToSignals as subscribeToSignals };
|
|
2986
|
-
}
|
|
2987
|
-
|
|
2988
|
-
type brain_CoherenceConfig = CoherenceConfig;
|
|
2989
|
-
type brain_CoherenceInput = CoherenceInput;
|
|
2990
|
-
type brain_CoherenceMetrics = CoherenceMetrics;
|
|
2991
|
-
type brain_CoherenceResult = CoherenceResult;
|
|
2992
|
-
type brain_KuramotoStepOptions = KuramotoStepOptions;
|
|
2993
|
-
type brain_OrderParameter = OrderParameter;
|
|
2994
|
-
declare const brain_calculateCoherence: typeof calculateCoherence;
|
|
2995
|
-
declare const brain_calculateCoherenceWithExplanations: typeof calculateCoherenceWithExplanations;
|
|
2996
|
-
declare const brain_getCoherenceSuggestions: typeof getCoherenceSuggestions;
|
|
2997
|
-
declare const brain_isCoherent: typeof isCoherent;
|
|
2998
|
-
declare const brain_kuramotoStep: typeof kuramotoStep;
|
|
2999
|
-
declare const brain_orderParameter: typeof orderParameter;
|
|
3000
|
-
declare const brain_phaseLockingValue: typeof phaseLockingValue;
|
|
3001
|
-
declare const brain_wrapTo2Pi: typeof wrapTo2Pi;
|
|
3002
|
-
declare const brain_wrapToPi: typeof wrapToPi;
|
|
3003
|
-
declare namespace brain {
|
|
3004
|
-
export { type brain_CoherenceConfig as CoherenceConfig, type brain_CoherenceInput as CoherenceInput, type brain_CoherenceMetrics as CoherenceMetrics, type brain_CoherenceResult as CoherenceResult, type brain_KuramotoStepOptions as KuramotoStepOptions, type brain_OrderParameter as OrderParameter, brain_calculateCoherence as calculateCoherence, brain_calculateCoherenceWithExplanations as calculateCoherenceWithExplanations, brain_getCoherenceSuggestions as getCoherenceSuggestions, brain_isCoherent as isCoherent, brain_kuramotoStep as kuramotoStep, brain_orderParameter as orderParameter, brain_phaseLockingValue as phaseLockingValue, brain_wrapTo2Pi as wrapTo2Pi, brain_wrapToPi as wrapToPi };
|
|
3005
2911
|
}
|
|
3006
|
-
|
|
3007
2912
|
/**
|
|
3008
|
-
*
|
|
2913
|
+
* A SkillManifest extends StackManifestV0 with skill-specific metadata.
|
|
3009
2914
|
*
|
|
3010
|
-
*
|
|
3011
|
-
*
|
|
3012
|
-
* via their system prompt.
|
|
2915
|
+
* This is the core type — a skill IS a stack manifest with agent orchestration
|
|
2916
|
+
* metadata. The `skill` field contains all presentation and execution metadata.
|
|
3013
2917
|
*
|
|
3014
|
-
*
|
|
2918
|
+
* The `TInput` parameter establishes compile-time correspondence between
|
|
2919
|
+
* the JSON Schema `inputSchema`, the typed `sampleInput`, and the runtime
|
|
2920
|
+
* input validated by `SkillRunner.start()`.
|
|
3015
2921
|
*/
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
toAgent?: string;
|
|
3020
|
-
type: AgentMessageType;
|
|
3021
|
-
payload: string;
|
|
3022
|
-
timestamp: number;
|
|
3023
|
-
runId: string;
|
|
3024
|
-
}
|
|
3025
|
-
type MessageHandler = (msg: AgentMessage) => void;
|
|
3026
|
-
interface AgentBus {
|
|
3027
|
-
publish(msg: AgentMessage): void;
|
|
3028
|
-
query(filter: {
|
|
3029
|
-
fromAgent?: string;
|
|
3030
|
-
type?: string;
|
|
3031
|
-
}): AgentMessage[];
|
|
3032
|
-
subscribe(agentId: string, handler: MessageHandler): () => void;
|
|
3033
|
-
getAll(): AgentMessage[];
|
|
2922
|
+
interface SkillManifest<TInput extends Record<string, unknown> = Record<string, unknown>> extends StackManifestV0 {
|
|
2923
|
+
/** Skill-specific metadata */
|
|
2924
|
+
skill: SkillMeta<TInput>;
|
|
3034
2925
|
}
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
2926
|
+
declare const SKILL_RUN_STATUSES: readonly ["pending", "running", "gate_pending", "paused", "resuming", "retrying", "completed", "failed", "cancelled"];
|
|
2927
|
+
type SkillRunStatus = (typeof SKILL_RUN_STATUSES)[number];
|
|
2928
|
+
|
|
2929
|
+
/**
|
|
2930
|
+
* Skill Registry + Catalog Bridge
|
|
2931
|
+
*
|
|
2932
|
+
* Follows the applet-node-adapter.ts pattern — registers skills into the
|
|
2933
|
+
* node catalog via registerManifestProvider for "skill:*" resolution.
|
|
2934
|
+
*
|
|
2935
|
+
* @module skills/registry
|
|
2936
|
+
*/
|
|
2937
|
+
|
|
2938
|
+
declare function registerSkill(skill: SkillManifest): void;
|
|
2939
|
+
declare function getSkill(slug: string): SkillManifest | undefined;
|
|
2940
|
+
declare function getAllSkills(): SkillManifest[];
|
|
2941
|
+
declare function getSkillsByCategory(category: SkillCategory): SkillManifest[];
|
|
2942
|
+
declare function getSkillCount(): number;
|
|
2943
|
+
/**
|
|
2944
|
+
* Ensures flagship skills are registered. Safe to call from API routes
|
|
2945
|
+
* (SSR context) where the client-side side-effect import hasn't run.
|
|
2946
|
+
* Idempotent — skips if registry is already populated.
|
|
2947
|
+
*/
|
|
2948
|
+
declare function ensureSkillsRegistered(): Promise<void>;
|
|
2949
|
+
|
|
2950
|
+
/**
|
|
2951
|
+
* AXON Signal Codes for Skills (0x0050-0x005F range)
|
|
2952
|
+
*
|
|
2953
|
+
* Follows the DEPLOY_SIGNAL_CODES pattern from lib/deploy/provider.ts.
|
|
2954
|
+
* Next available range after deploy's 0x0040-0x004F.
|
|
2955
|
+
*
|
|
2956
|
+
* @module skills/signals
|
|
2957
|
+
*/
|
|
2958
|
+
declare const SKILL_SIGNAL_CODES: {
|
|
2959
|
+
/** Skill execution started */
|
|
2960
|
+
readonly SKILL_START: 80;
|
|
2961
|
+
/** Individual agent within skill started */
|
|
2962
|
+
readonly SKILL_AGENT_START: 81;
|
|
2963
|
+
/** Individual agent within skill completed */
|
|
2964
|
+
readonly SKILL_AGENT_COMPLETE: 82;
|
|
2965
|
+
/** An artifact has been produced */
|
|
2966
|
+
readonly SKILL_ARTIFACT_READY: 83;
|
|
2967
|
+
/** Progress update (percentage, current step) */
|
|
2968
|
+
readonly SKILL_PROGRESS: 84;
|
|
2969
|
+
/** Skill execution completed successfully */
|
|
2970
|
+
readonly SKILL_COMPLETE: 85;
|
|
2971
|
+
/** Skill execution paused — awaiting user gate decision */
|
|
2972
|
+
readonly SKILL_GATE_PENDING: 86;
|
|
2973
|
+
/** Peer review cycle triggered for an agent */
|
|
2974
|
+
readonly SKILL_PEER_REVIEW: 87;
|
|
2975
|
+
/** Dynamic delegation triggered by an agent */
|
|
2976
|
+
readonly SKILL_DELEGATION: 88;
|
|
2977
|
+
/** Agent output refinement iteration (convergence engine) */
|
|
2978
|
+
readonly SKILL_AGENT_REFINE: 89;
|
|
2979
|
+
/** Population selection round completed */
|
|
2980
|
+
readonly SKILL_SELECTION: 90;
|
|
2981
|
+
/** Backpressure event in skill chain */
|
|
2982
|
+
readonly SKILL_BACKPRESSURE: 91;
|
|
2983
|
+
/** Resource budget exceeded */
|
|
2984
|
+
readonly SKILL_BUDGET_EXCEEDED: 92;
|
|
2985
|
+
/** Skill execution error */
|
|
2986
|
+
readonly SKILL_ERROR: 95;
|
|
2987
|
+
};
|
|
2988
|
+
type SkillSignalCode = (typeof SKILL_SIGNAL_CODES)[keyof typeof SKILL_SIGNAL_CODES];
|
|
2989
|
+
type SkillEventType = "skill:start" | "skill:agent_start" | "skill:agent_complete" | "skill:artifact_ready" | "skill:progress" | "skill:complete" | "skill:gate_pending" | "skill:peer_review" | "skill:delegation" | "skill:agent_refine" | "skill:selection" | "skill:backpressure" | "skill:budget_exceeded" | "skill:error";
|
|
3041
2990
|
|
|
3042
2991
|
/**
|
|
3043
|
-
*
|
|
2992
|
+
* Skill SDK — Skill execution and management
|
|
3044
2993
|
*
|
|
3045
|
-
*
|
|
3046
|
-
* Hides
|
|
2994
|
+
* Skill types, registry access, and signal constants.
|
|
2995
|
+
* Hides SkillManifest internals, runner pipeline, agent-executor, topo-sort.
|
|
3047
2996
|
*
|
|
3048
2997
|
* @copyright © 2026 Intuition Labs LLC. All rights reserved. Patent Pending.
|
|
3049
|
-
* @module sdk/
|
|
3050
|
-
*/
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
type
|
|
3058
|
-
type
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
2998
|
+
* @module sdk/skill
|
|
2999
|
+
*/
|
|
3000
|
+
|
|
3001
|
+
declare const skill_SKILL_CATEGORIES: typeof SKILL_CATEGORIES;
|
|
3002
|
+
declare const skill_SKILL_RANKS: typeof SKILL_RANKS;
|
|
3003
|
+
declare const skill_SKILL_RUN_STATUSES: typeof SKILL_RUN_STATUSES;
|
|
3004
|
+
declare const skill_SKILL_SIGNAL_CODES: typeof SKILL_SIGNAL_CODES;
|
|
3005
|
+
declare const skill_SKILL_TIERS: typeof SKILL_TIERS;
|
|
3006
|
+
type skill_SkillAgent = SkillAgent;
|
|
3007
|
+
type skill_SkillCapabilities = SkillCapabilities;
|
|
3008
|
+
type skill_SkillCategory = SkillCategory;
|
|
3009
|
+
type skill_SkillEventType = SkillEventType;
|
|
3010
|
+
type skill_SkillHealth = SkillHealth;
|
|
3011
|
+
type skill_SkillManifest<TInput extends Record<string, unknown> = Record<string, unknown>> = SkillManifest<TInput>;
|
|
3012
|
+
type skill_SkillMeta<TInput extends Record<string, unknown> = Record<string, unknown>> = SkillMeta<TInput>;
|
|
3013
|
+
type skill_SkillRank = SkillRank;
|
|
3014
|
+
type skill_SkillRunStatus = SkillRunStatus;
|
|
3015
|
+
type skill_SkillSignalCode = SkillSignalCode;
|
|
3016
|
+
type skill_SkillTier = SkillTier;
|
|
3017
|
+
declare const skill_ensureSkillsRegistered: typeof ensureSkillsRegistered;
|
|
3018
|
+
declare const skill_getAllSkills: typeof getAllSkills;
|
|
3019
|
+
declare const skill_getSkill: typeof getSkill;
|
|
3020
|
+
declare const skill_getSkillCount: typeof getSkillCount;
|
|
3021
|
+
declare const skill_getSkillsByCategory: typeof getSkillsByCategory;
|
|
3022
|
+
declare const skill_registerSkill: typeof registerSkill;
|
|
3023
|
+
declare namespace skill {
|
|
3024
|
+
export { skill_SKILL_CATEGORIES as SKILL_CATEGORIES, skill_SKILL_RANKS as SKILL_RANKS, skill_SKILL_RUN_STATUSES as SKILL_RUN_STATUSES, skill_SKILL_SIGNAL_CODES as SKILL_SIGNAL_CODES, skill_SKILL_TIERS as SKILL_TIERS, type skill_SkillAgent as SkillAgent, type skill_SkillCapabilities as SkillCapabilities, type skill_SkillCategory as SkillCategory, type skill_SkillEventType as SkillEventType, type skill_SkillHealth as SkillHealth, type skill_SkillManifest as SkillManifest, type skill_SkillMeta as SkillMeta, type skill_SkillRank as SkillRank, type skill_SkillRunStatus as SkillRunStatus, type skill_SkillSignalCode as SkillSignalCode, type skill_SkillTier as SkillTier, skill_ensureSkillsRegistered as ensureSkillsRegistered, skill_getAllSkills as getAllSkills, skill_getSkill as getSkill, skill_getSkillCount as getSkillCount, skill_getSkillsByCategory as getSkillsByCategory, skill_registerSkill as registerSkill };
|
|
3065
3025
|
}
|
|
3066
3026
|
|
|
3067
3027
|
/**
|
|
@@ -3545,4 +3505,4 @@ declare function createAxonBus(): InMemoryAxonBus;
|
|
|
3545
3505
|
*/
|
|
3546
3506
|
declare const SDK_VERSION = "1.0.0-rc.1";
|
|
3547
3507
|
|
|
3548
|
-
export { type AxonMessage, type AxonMessageBus, brain as Brain,
|
|
3508
|
+
export { type AxonMessage, type AxonMessageBus, brain as Brain, core as Core, InMemoryAxonBus, index as L0, mesh as Mesh, protocol as Protocol, ProtocolBridge, SDK_VERSION, skill as Skill, terminal as Terminal, createAxonBus, createProtocolBridge };
|