Skip to content

taras/tisyn

 
 

Repository files navigation

Tisyn

Tisyn (pronounced like the chicken) is a system for building agents that can coordinate predictably across boundaries.

It represents work as explicit, serializable program structure so agents can hand off tasks safely, stream progress, bound concurrent work, and continue after interruption without losing the execution story.

Tisyn is organized as a set of small packages with clear boundaries. Some packages define the program model, some define semantics, some handle execution and continuation, and some provide the agent and transport layers needed to move work across processes or machines.

What Tisyn is for

Tisyn is for systems where work needs to cross boundaries without becoming ambiguous.

Typical examples include:

  • handing work from a host to a remote agent
  • delegating a single task or a subtree of tasks
  • streaming progress back while work is running
  • resuming after interruption without losing the execution story
  • keeping concurrent work bounded so unnecessary background activity does not leak resources

The key idea is that Tisyn makes the work itself explicit. Instead of depending on opaque in-memory runtime state, Tisyn represents execution as serializable structure that can be validated, transported, interpreted, and resumed.

Core properties

Explicit work

Tisyn programs are data. They can be inspected, validated, transported, stored, and replayed.

Predictable boundaries

Agents exchange explicit work and explicit results rather than hidden runtime state.

Bounded concurrency

Concurrent work is structured, so child work stays tied to its parent and does not continue indefinitely after its purpose is gone.

Durable continuation

Execution can resume from journaled results after interruption without requiring the interpreter’s in-memory state to be serialized.

Package relationships

Tisyn is easiest to understand as layers:

  1. Program model and validation

  2. Semantics

    • @tisyn/kernel: evaluation, environments, core errors, and durable event shapes
  3. Execution and continuation

  4. Agents and remoting

  5. Tooling and verification

    • @tisyn/compiler: compile restricted generator-shaped TypeScript into Tisyn IR
    • @tisyn/dsl: parse Tisyn Constructor DSL text into IR (inverse of print())
    • @tisyn/conformance: fixture harness for validating runtime behavior

Recommended reading order

Start in different places depending on what you want to learn.

Package guide

Package Purpose
@tisyn/ir AST types, constructors, walkers, printers, and value types
@tisyn/validate IR validation and MalformedIR errors
@tisyn/kernel Core evaluation, environments, and runtime error/event types
@tisyn/durable-streams Durable append-only stream abstractions used by replay
@tisyn/runtime Execution of IR, including durable and remote flows
@tisyn/agent Typed agents, implementations, dispatch, and invocation helpers
@tisyn/protocol Parsed/constructed protocol messages for host-agent communication
@tisyn/transport Protocol sessions and transports like stdio, websocket, worker, and sse-post
@tisyn/compiler Compile restricted TypeScript generator functions into Tisyn IR
@tisyn/dsl Parse Tisyn Constructor DSL text into IR; inverse of print()
@tisyn/conformance Execute fixtures against the runtime to verify behavior

Typical flows

Build and run IR directly

import { Add, Q } from "@tisyn/ir";
import { execute } from "@tisyn/runtime";

const ir = Add(Q(20), Q(22));
const { result } = yield* execute({ ir });

Define an agent and install a remote transport

import { agent, operation, invoke } from "@tisyn/agent";
import { installRemoteAgent, websocketTransport } from "@tisyn/transport";

const math = agent("math", {
  double: operation<{ value: number }, number>(),
});

yield* installRemoteAgent(math, websocketTransport({ url: "ws://localhost:8080" }));
const result = yield* invoke(math.double({ value: 21 }));

For the detailed agent model and API examples, see @tisyn/agent.

Specifications

Document Scope
Tisyn Specification 1.0 Core language: values, expressions, and evaluation rules
Kernel Specification Kernel semantics, environments, and effect dispatch
Agent Specification 1.1.0 Typed agent declarations, implementations, and invocation
Compiler Specification 1.1.0 TypeScript-to-IR compilation rules and restrictions
Compound Concurrency Spec all and race orchestration semantics
Authoring Layer Spec Generator-based authoring format and contract declarations
Constructor DSL Specification Grammar, constructor table, and recovery semantics for the DSL parser
Architecture System architecture and package relationships

Design summary

Tisyn separates concerns cleanly:

  • the program model is explicit and serializable
  • the kernel defines how expressions evaluate
  • the runtime executes and continues work
  • the agent layer moves work across boundaries
  • the transport layer carries messages between hosts and agents

That separation is what lets Tisyn support deterministic coordination, safe delegation, bounded concurrency, and durable continuation in one system.

About

Tisyn is a deterministic coordination layer for agents: explicit work trees, safe cross-boundary handoffs, structured concurrency, and durable continuation.

Topics

Resources

Stars

Watchers

Forks

Contributors

No contributors

Languages

  • TypeScript 99.5%
  • JavaScript 0.5%